[Android] Couldn't create socket


My program is working on Windows and Linux while I use SDL_net to transfert data, but it doesn’t work on Android.

No error during the SDLNet_ResolveHost ( &ip, “”, 12345 ) != 0
Then a SDLNet_GetError: Couldn’t create socket during the SDLNet_TCP_Open( &ip );

I use SDL2.0.5 and SDL_net2.0.1, api 23 and Android Studio 2.3.3

Maybe it’s the port, because I use 12345, which works on Windows (after allowing that port)

But I don’t know if I have to do something like that on Android?

Do you know which port I can use for my SDL2 application under Android? :door:

Thanks a lot for any help :grinning:
Merry Christmas :gift:

This is probably a silly question, but did you remember to request android.permission.INTERNET in your AndroidManifest.xml?


Thanks Richard, it’s working now on Android.

Sorry I’m a beginner in the Android Env, and there so many files, even C++ looks easier :sunglasses:

Thanks all for your support

1 Like