Android bases on Linux and thus has the same limitations that the root permissions are required to open a socket on ports below 1024.
For opening a socket in an app on a port greater than or equal to 1024 the app itself needs to have the static permission:
<uses-permission android:name="android.permission.INTERNET" />
defined in its AndroidManifest.xml
. Without that permission no network communication is allowed by the Android operating system. With the permission you can open client and server sockets to perform network operations as usual.
When opening a socket for running a server, be aware that usually this only makes sense on the WiFi interface. On the mobile network interface you can open up a socket, but as mobile network providers don't assign a public IP, you can't reach a server running on a Android system connected via mobile data to the Internet.