Hi.
I'm testing MANET stuff out on a set of Lenovo A1s. The basic GingerBread version they shipped with has been working fine with MANET Manager. The route info shows all devices, and they can send messages back and forth.
However, with one of them I was forced to upgrade to the newer Ice Cream Sandwich firmware and although the routing tables seem to be setup correct, I noticed that sending messages from the ICS A1 pops a toast up as "Null". I can broadcast a message and receive fine from GB -> ICS, but not from ICS -> GB.
Here's the LogCat dump from right after I touch send:
03-15 00:08:07.421: E/audio_hw_default(1145): ICS-SASKEN:0
03-15 00:08:07.421: E/audio_hw_default(1145): ICS-SASKEN:2
03-15 00:08:07.492: W/InputManagerService(1246): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@413e1548
03-15 00:08:08.281: E/audio_hw_default(1145): ICS-SASKEN:0
03-15 00:08:08.281: E/audio_hw_default(1145): ICS-SASKEN:2
03-15 00:08:08.859: E/audio_hw_default(1145): ICS-SASKEN:0
03-15 00:08:08.859: E/audio_hw_default(1145): ICS-SASKEN:2
03-15 00:08:09.101: D/dalvikvm(2013): GC_CONCURRENT freed 429K, 10% free 6689K/7431K, paused 3ms+3ms
03-15 00:08:09.953: W/System.err(1999): android.os.NetworkOnMainThreadException
03-15 00:08:09.953: W/System.err(1999): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099)
03-15 00:08:09.953: W/System.err(1999): at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:175)
03-15 00:08:09.953: W/System.err(1999): at libcore.io.IoBridge.sendto(IoBridge.java:463)
03-15 00:08:09.960: W/System.err(1999): at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:182)
03-15 00:08:09.960: W/System.err(1999): at java.net.DatagramSocket.send(DatagramSocket.java:287)
03-15 00:08:09.960: W/System.err(1999): at org.span.manager.SendMessageActivity.sendMessage(SendMessageActivity.java:189)
03-15 00:08:09.960: W/System.err(1999): at org.span.manager.SendMessageActivity.access$5(SendMessageActivity.java:173)
03-15 00:08:09.960: W/System.err(1999): at org.span.manager.SendMessageActivity$1.onClick(SendMessageActivity.java:104)
03-15 00:08:09.960: W/System.err(1999): at android.view.View.performClick(View.java:3511)
03-15 00:08:09.960: W/System.err(1999): at android.view.View$PerformClick.run(View.java:14105)
03-15 00:08:09.960: E/audio_hw_default(1145): ICS-SASKEN:0
03-15 00:08:09.960: E/audio_hw_default(1145): ICS-SASKEN:2
03-15 00:08:09.968: W/System.err(1999): at android.os.Handler.handleCallback(Handler.java:605)
03-15 00:08:09.968: W/System.err(1999): at android.os.Handler.dispatchMessage(Handler.java:92)
03-15 00:08:09.976: W/System.err(1999): at android.os.Looper.loop(Looper.java:137)
03-15 00:08:09.976: W/System.err(1999): at android.app.ActivityThread.main(ActivityThread.java:4424)
03-15 00:08:09.984: W/System.err(1999): at java.lang.reflect.Method.invokeNative(Native Method)
03-15 00:08:09.984: W/System.err(1999): at java.lang.reflect.Method.invoke(Method.java:511)
03-15 00:08:09.984: W/System.err(1999): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-15 00:08:09.984: W/System.err(1999): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-15 00:08:09.992: W/System.err(1999): at dalvik.system.NativeStart.main(Native Method)
03-15 00:08:10.117: D/dalvikvm(1246): GC_FOR_ALLOC freed 314K, 12% free 9760K/11015K, paused 75ms
03-15 00:08:10.218: D/MainActivity(1999): onStart()
03-15 00:08:10.218: D/MainActivity(1999): onResume()
03-15 00:08:10.320: D/MainActivity(1999): Temp ==> 260 -- Celsius ==> 26 -- Fahrenheit ==> 79
03-15 00:08:10.484: D/OpenGLRenderer(1999): Flushing caches (mode 0)
I ran into the same problem with my MANET app when I tried running it on ICS. Google requires you thread off all network operations that might be linked to the main UI thread. I don't think it's supper accurate in determining this though. I had my broadcast sender as a Runnable in a Service, but it would still complain. (apparently a Service isn't a completely new thread!)
When NetworkOnMainThreadException is thrown it doesn't have a message, so logging or toasting it will be "null".
The work around (or proper way to handle it) is to wrap your message send in an AsyncTask class. It'll solve any NetworkOnMainThreadException errors.
I would take a look and offer a fix but I wouldn't be able to look at it before next week, so I thought I would just point out the problem and solution for now. Hope this helps.