socket java.net.BindException: bind failed: EACCES (Permission denied)

It took a long time today to find out the real problem.

There are two situations most likely to cause the whole exception:

1. No permission is given;

a. Permission application is not added in androidmanifest.xml;

<uses-permission android:name="android.permission.INTERNET"/>

b. The format of permission application is incorrect

<!-- Mistake -->
<uses-permission android:name="android.permission.INTERNET"></uses-permission>

c. The permission is manually shielded by the user;

2. Port less than 1024; Set a larger one, not more than the largest one;

Read More: