Question

I'm coming behind another developer who built a PhoneGap/Cordova HTML 5 application, currently only targeting IOS. Admittedly, I have zero experience with Cordova and hybrid mobile apps.

I can open up the XCode IDE and run the application and I can see the web page (application) load up in the iPad emulator, so long as I have his Node.js application running.

I guess I'm confused about the context in which the actual index.html that makes up the HTML 5 application runs. Does it run on the iPad under a mini web server (http://local or http://localhost) or does the index.html run on a file system path (something like file://path-to-file/index.html)?

I've used Icenium (Telerik AppBuilder) and created an empty project for which I copied all the HTML 5 code into and ran it. Upon inspecting/debugging the page in the emulator, I see that the page is being served up with a base URL of http://local.

Lastly, I simply tried opening the index.html by double-clicking it and running it in the browser (file:///...builds/ios/www/index.html), and the application didn't work

In summary, as long as I run the website in an emulator, the application loads and runs file, but it won't run loading it from the file system.

My assumption is the scripts are expecting an http base URL and the file:/// url is throwing it off. Does this sounds like a reasonable explanation?

Do Cordova apps run the HTML 5 apps under HTTP?

Thank you.

Was it helpful?

Solution

they run on a file system path (something like file://path-to-file/index.html)

if you are using something from the phonegap API it won't work on a desktop browser

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top