I have a question about using the following line in a native c program:
#include <sys/socket.h>
#include <errno.h>
void testSocket()
{
int sockfd = socket(AF_INET, SOCK_STREAM, 0);
int err = errno;
}
The socket fails to be created (sockfd = -1) and the errno = 13. I have the following defined in my Manifest:
<uses-permission android:name="android.permission.INTERNET"/>
Can anyone tell me any experience they have / knowledge of why this wouldn't work? I'm pulling up blanks at this point.
What permission do I need to access Internet from an android application?
The part of this answer which helped me was this: You have to add this line:
outside the application tag in your AndroidManifest.xml