My Android PhoneGap application works completelly as expected when I copy all the web files (html, JS, CSS...) to the www folder of the project, and compile the application with these files. But when I do not copy them, and make a redirection to my Web Server containing these files (i.e. in the WWW folder there is only one file: index.html with a redirection to my server) phonegap does not work in the application anymore.
Is there a way to get phonegap to work, when the application content files are delivered by a remote server and not compiled with the application?
It can be done. Nothing can prevent you from doing that.
Phonegap + Android :
In your main activity class, method onCreate change loadUrl to:
super.loadUrl("http://.../index.html");
iPhone + Phonegap ia another story, still it can be done. Because there's a lot of changes here's a tutorial: http://www.joeldare.com/wiki/open_a_url_in_phonegap
One more thing, you must enable internet connection for Phonegap.
As you are using the android platform add this line to your AndroidManifest:
<uses-permission android:name="android.permission.INTERNET" />
Ah, one more thing, a viewport meta tag must be set in your html file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With