The idea is to start a chat. So I have this properties in my class:
private MulticastSocket so;
private EditText messageBoard;
private InetAddress serverAddr
If you just want an easy work-around this, specify a minimum SDK version of Froyo or Gingerbread and omit the targetSdkVersion:
android:minSdkVersion="8"
This is done to make sure you do not block the UI thread from handling any input events from the user.By blocking the UI thread your application cannot perform any event handling routines.
Normally most UI systems have a watchdog timer,which keeps watching for any long operation on the UI thread and if the UI thread is blocked for more than a threshold(probably 10-20 seconds in android devices varying by manufacturer/OS version) the watchdog interrupts and causes a 'Application Not responding'(a.k.a ANR) to pop-up.
this line:
Caused by: android.os.NetworkOnMainThreadException
Tells you what is going on.
You are attempting to access a network function on the Main(UI) thread. starting with Honeycomb the system raises an Exception when you do this.
To fix you just need to move any thing that is touching the network to its own thread.