i've created a small app to explore twitter friendship.
it works well on desktop.
Loading it on a samsung Tab 10.1, it returns this error:
android.os.NetworkOnMainThreadException
i've read some articles about it, understanding (in simple words) that newer version of android (3.0 +) won't allow networking in the main thread, to avoid to block the application during the loading.
it makes sense to me. but as i'm just sketching out some ideas and i won't bother to create a multithread superfine application, i'm wondering if there's a way to disable this feature.
i've found on stackoverflow
this solution (for java applications). it states to add these lines:
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
as i don't really know how this sort of things work i tried to put it in the setup() function.
it loads without errors, but it don't solve the problem.
"Lost connection with device while launching. Try again".
this is the console log:
Android SDK Tools Revision 20.0.1
Installed at /Applications/android-sdk-macosx
Project Type: Application
Project Target: Android 2.3.3
API level: 10
Library dependencies:
No Libraries
------------------
API<=15: Adding annotations.jar to the classpath.
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
No AIDL files to compile.
No RenderScript files to compile.
Generating resource IDs...
Generating BuildConfig class.
Converting compiled files and external libraries into /var/folders/oC/oCNrKWRUGl8nf6zQlkSZQk+++TI/-Tmp-/android8401496608843444431sketch/bin/classes.dex...
Creating full resource package...
Current build type is different than previous build: forced apkbuilder run.
Creating android_test01-debug-unaligned.apk and signing it with a debug key...