This is a quick way to do this, better if you expanded to make a more real life:
1- download phonegap
2- Create your first application using this tutorial or using a phone screen saver, how to look in the eyes
3, as soon as you have it, release the server side. We need an API, the easiest way to do this:
<?php header('Access-Control-Allow-Origin: *'); header('Cache-Control: no-cache, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Content-type: application/json'); if($_GET['nameofFunction'] == 'getHomepageContent'){ require_once('controllers/homeController.php'); $objHome = new homeController(); $jsonReturn = $objHome->gethome(); echo($jsonReturn); } ?>
4 create this controller to control the API request, for example, something like this:
<?php class homeController { public function __contruct(){ } public function gethome(){
5 We returned to the phonegap application, now make sure that you include all the necessary files, jquery, jquerymobile, cordovajs, itouch, iscroll ....
6 - create a function that will be executed at boot time and will call ajax on api, this will return json, just parse with jquery and you are good to go.
source share