There is a rather large difference between a jQuery Mobile (or HTML5, appMobi, sencha etc) web app and using those same technologies in PhoneGap to create a native app. The main difference is how the code interacts when built directly on a server and run in a web browser versus running directly on the user’s device. By definition, a mobile web app is a remote site that runs off a web server at all times. That allows us to easily use programming languages such as PHP, Ruby and Python to create them. Using those languages, we can perform easy functions such as creating contact forms and sending mail directly from the server.
Below is a picture describing how a regular mobile web app that runs in a browser via a website looks and functions.
So then, how do we send mail using contact forms? Or pull MySQL data from a remote server and populate our native web app built with PhoneGap?
The question is how do we allow someone to enter a contact form, pass that data to the server which would then processes the data from the form and email it to the designated recipient?
From there you can use your PHP functions to do whatever you would like with your data. Such as storing it in a database, process it using the mail() function and other items.
What other times would you need to use a remote server?
So here is a list of a few tasks that would use this method for communicating. It’s a guideline as you go forward and build your apps.
- Transfering data from a remote MySQL server to your native application
- Processing a contact form (without using native mail functions) to your server
- Communicating with remote API’s
- Parsing remote JSON
- Parsing XML Files