Populate your PhoneGap App with Data from an External Server DB


With this article, we’ll pull data from a server and show it in the app. We’ll create a database table on a server, load it with data, then set up the scripts to make it all work. You’ll need a MySQL server and the ability to upload and change files on it.

My development environment:

Mac OS X 10.9.1 on latest Mac Mini
Cordova CLI 3.4.0
For Android 4.3, 4.4 v19
Testing in device: Android-19, Nexus 7 with 4.3
No Jquery or other JS or CSS packages used

This post assumes you already have your Cordova PhoneGap environment already set up. Look elsewhere on this site for setting up for iOS or Android.

Continue reading

Advertisements

Making an Offline Web App: From Start to Finish, updated 9/21/2012


Here are the steps I followed to create my first successful web app

Create the app files first

1) Create a web app with HTML, CSS, and JS that will support HTML5 specs, and put all the files in their various folders. Make sure all is working in the browser. Ideally, one should use a Jquery-type html page where all pages and content are linked to just one html page, not multiple html pages. That way, when the one page is loaded in the mobile brower, all resources are cached at once and will be available for offline use immediately. Otherwise, one would have to navigate through every page to cache all the resources.

Put all folders in a central folder named just for that app, such as /widget_appname/ if your app is about a widget.

2) In your index.html page, make your <title> the name you want under the web app icon on the home screen, up to 11 characters.

3) Make a “file not found” notice and name it “offline.html” with perhaps a way for the visitor to email you of this problem. Continue reading