javascript - JQuery Mobile + PhoneGap for Android - Error loading index.html -
i trying basic phonegap + jquery mobile program running android platform 2.2, getting application error "the connection server unsuccessful (file:///android_asset/www/index.html)" in android emulator when try run application in android emulator platform 2.2 on windows xp, eclipse 3.7.
the file loads if remove references , syntax of jquery mobile html file, project fine there's missing initialization of jquery mobile. using phonegap 0.9.6 jquery mobile version *1.0b1* jquery version 1.6.1 (i tried jqm version 1.0a2 jquery 1.4.4 same error).
if remove references jquery mobile html file able load program in emulator without errors.
i looked @ several examples on web , tried them are, of them show same error. files as:
<!doctype html> <html> <head> <meta name="viewport" content="width=320; user-scalable=no" /> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>phonegap jqm</title> <link rel="stylesheet" href="jquery.mobile-1.0b1.min.css" type="text/css" charset="utf-8" /> <script src="jquery-1.6.1.min.js"></script> <script type="text/javascript" charset="utf-8" src="phonegap.0.9.6.js"></script> <script type="text/javascript" charset="utf-8" src="main.js"></script> <script src="jquery.mobile-1.0b1.min.js"></script> </head> <body onload="init();"> <div data-role="page" data-theme="e"> <div data-role="header"> <h1>phonegap jqm</h1> </div> <div data-role="content"> <h1>my content</h1> </div> <div data-role="footer"> <h1>my footer</h1> </div> </body> </html>
the main.js file has only:
function init() { document.addeventlistener("deviceready", deviceinfo, true); }
what missing?
the problem due speed of emulator network slow complete communication in timely fashion.
set 60 second timeout in phonegap adding following property src/com/phonegap/xxx.java
:
super.setintegerproperty("loadurltimeoutvalue", 60000);
references:
phonegap 0.9.3 onreceivederror: error code=-6 description=the connection server unsuccessful
Comments
Post a Comment