Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
54
rated 0 times [  57] [ 3]  / answers: 1 / hits: 22822  / 13 Years ago, mon, october 3, 2011, 12:00:00

I am developing a android app using phonegap, it calls a website (http://siteaddress.com:8081) to get json encoded data. This is working fine on the emulator, then I built the android package .apk file using phonegap build but when i installed this package on my android phone and started the app, it force closes the application showing the error The connection to the server was unsuccessful.(file:///android_asset/www/index.html).



I have built the app using phonegap build, passed it the index.html as well as tried the .zip file package but still getting this error. I tried searching for this error and also included the below code in my app as suggested on some sites but still it is giving error.



super.setBooleanProperty(loadInWebView, true);
super.setIntegerProperty(loadUrlTimeoutValue, 60000);


Has this got something to do with the website that i am trying to call from my app? I tried opening that site in the mobile browser but it didn't opened but the website works fine on a desktop browser. Is there something wrong that i am doing?


More From » android

 Answers
148

I'm guessing its the port number your using. Have you tried using port 80 for your server rather than 8081? Its possible that port isn't open on your device.


[#89821] Friday, September 30, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
martin

Total Points: 405
Total Questions: 93
Total Answers: 93

Location: Mexico
Member since Sun, Jul 25, 2021
3 Years ago
;