Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App can't connect to network with Android ICS

I am trying to port a Phonegap/Cordova app to Android. It works on earlier versions of the SDKs but not on android ICS (SDK 14). I either get java.io.IOException: An established connection was aborted by the software in your host machine, or the app loads, but can't connect to the internet.

I have <uses-permission android:name="android.permission.INTERNET"></uses-permission> and have checked that their are no duplicate adb or eclipse.exe running. It also cannot connect to the internet on external devices that run android 4+ as well.

My manifest has <uses-sdk android:targetSdkVersion="14" android:minSdkVersion="7" />

I was pointed in the direction of trace view which when I try to run Network Statistics I get an error "Problem reading xt_qtaguid network statistics fro selected device".

An SO answer here indicates there might be an issue with a kernal and suggests backporting, but have no idea how to to do this or if its the right thing to do. My version of Eclipse is Eclipse SDK 3.7.2

like image 612
danssker Avatar asked Nov 13 '22 01:11

danssker


1 Answers

since android 4. when somebody trying to do network stuff in UI Thread android with throw a android.os.NetworkOnMainThreadException . maybe that is a problem?

like image 165
s_id Avatar answered Jan 10 '23 19:01

s_id