Socket was added in API Level 1
1. Declare a Socket named mySocket.
2. In the MainActivity.java file, in the onCreate method, add the line below. This will initialize the mySocket object to null.
mySocket = null;
3. Compile and run!
Next Recommended Article: How to Create a New Streaming Socket Connected to Target Host
Resources:
http://developer.android.com/reference/java/net/Socket.html
http://android-er.blogspot.com/2011/01/simple-communication-using.html
Popular Posts
- Solution: error: Error parsing XML: unbound prefix
- android:background - Change the Background Color of an EditText
- android:requiresFadingEdge
- Cursor getColumnIndexOrThrow - Get the Index for a Column Name
- Change the line spacing between lines of text in an TextView/EditText, using lineSpacingExtra
- Solution: Running Android Lint has encountered a problem Failed
- android:maxWidth - Set the Maximum Width of TextView
- How to Register an Activity that Responds to NFC tags for URI's that point to a URL
- android:ellipsize - Add an ellipsis(...) in a TextView
- How to Install an SDK package