Phonegap, Connection To Server Unsuccessful
Solution 1:
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);
Solution 2:
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>
Solution 3:
This solved my problem
@OverridepublicvoidonCreate(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.
Solution 4:
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.
Edit:
Some other things to check:
- The browser is able to access the internet
- Permissions to access the internet.
- Try downloading the jquery, and jqm libraries to the device and storing them with
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.
Solution 5:
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>
Post a Comment for "Phonegap, Connection To Server Unsuccessful"