Comments (3)
Thanks for reporting the problem. We ran into the
NetworkOnMainThreadException a while back. It seems that our fixes never
made it to GitHub because they were in a different branch of the code. Just
as you mentioned, we switched over to using AsyncTasks. Right now we're are
BlackHat EU presenting SPAN. We'll merge the fix and push the code when we
get back to the States.
- stoker
On Fri, Mar 15, 2013 at 1:17 AM, duhmojo [email protected] wrote:
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.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/6
.
from android-manet-manager.
Ok, good to know. Will you be updating the version of MANET Manager in Play as well then? No rush. Things are working ok for me right now.
Have fun at BH!
from android-manet-manager.
I did some more testing. I never encounter a NetworkOnMainThreadException
on any of my JB, ICS, or GB devices if I build the Manet Manager with API
9. The exception is thrown when I build using API 14. The Manet Manager app
posted to Google Play uses API 9. I assume you only encountered the problem
when building the code from GitHub yourself.
I just pushed Manet Manager version 4 to Google Play. From a user's point
of view it shouldn't change anything, it just uses an AsyncTask for sending
text messages.
Also, I just pushed the code to GitHub.
When you do code checkins, please keep the API level at 9 to ensure the
greatest backwards compatibility, unless you use a feature that requires a
higher API level. If that's the case, let's talk. In the future we'll be
moving to API 14 to support NFC config file exchanges.
- stoker
On Fri, Mar 15, 2013 at 10:22 AM, duhmojo [email protected] wrote:
Ok, good to know. Will you be updating the version of MANET Manager in
Play as well then? No rush. Things are working ok for me right now.Have fun at BH!
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-14963211
.
from android-manet-manager.
Related Issues (20)
- Interaction between connectToService/sendStartAdhocCommand and disconnectFromService/sendStopAdhocCommand HOT 38
- Manet Manager can get into a funky state where it will refuse to setup the manet HOT 3
- Adding support for Samsung Galaxy S4 HOT 25
- is there any way to get tx power in android...? HOT 1
- Bluetooth tethering + Wifi appears to drop OLSR packets HOT 4
- Does DNS work? HOT 3
- Is there any APIs for developers to do further work? HOT 2
- Adding support for multiple radios HOT 1
- Adding manet manager to a new app HOT 1
- How to connect application to manet manager (use olsr) HOT 3
- Detect other device IP HOT 5
- Manet application not working HOT 6
- Implementing willingness HOT 2
- searching for a .config for galaxy s4 sgh-i337 HOT 2
- Manet unable to interact properly with more than 2 devices
- compile edify
- How to build manet manager using android studio
- Error in executing the app on androoid studio HOT 1
- Where are the ad-hoc kernels? HOT 1
- How do I modify OLSR? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-manet-manager.