I\'m trying to write an Android app with phonegap, and I\'m writing a static front page with buttons, which was working until I introduced jQuery mobile and jQuery (which ar
Far better solution is to keep a extremely light file as for initial load and then redirect to original index.html. For example:
<!doctype html>
<html>
<head>
<title>tittle</title>
<script>
window.location = './index.html';
</script>
<body>
</body>
</html>
I suspect that the problem is that you have the super.loadUrl()
entered incorrectly.
loadUrl should have this string file:///android_asset/www/index.html
and actually be located in assets/www/
.
The missing 's' threw me off personally.
Some other things to check:
index.html
. Because the emulator is slow, it may be interfering with the page's response to downloading the libraries. Storing locally should avoid that.What exactly do you mean by "linked as external files"?
The jQuery Mobile and jQuery sources either need to be in the assets/www directory or linked to externally on an accessible cdn site with wireless or mobile data enabled.
There's an example here.
Also, see JQuery Mobile + PhoneGap for Android - Error loading index.html - Within your custom Activity file before calling super.loadUrl add the following line: super.setIntegerProperty("loadUrlTimeoutValue", 60000);
This solved my problem
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/home/index.html");
super.setIntegerProperty("loadUrlTimeoutValue", 10000);
I have added super.setIntegerProperty("loadUrlTimeoutValue", 10000); to com.mypackage.xxx.java file for 10 second waiting waiting time.
hi i think u load multiple scripts in starting time so u do some thing like this
<!doctype html>
<html>
<head>
<title>tittle</title>
<script>
window.location='./main.html';
</script>
<body>
</body>
</html>