background preloader


Facebook Twitter

002 Jeff Linwood and PhoneGap - Modules Unraveled Podcast. Phonegap. Phonegap is an open source platform that allows HTML5 and JavaScript created apps to be compiled into native apps that can be uploaded onto the app stores for Android, iPhone and Blackberry.


This project comprises of two parts: an Android application based on the Phonegap libraries a Drupal 7 module which interfaces the Android app with Drupal The Phonegap HTML5 code is generic, and will also work on iPhone and Blackberry devices, when compiled within the Phonegap framework. The module currently handles three key functions: Login / AuthenticationUploading of articlesListing of articles - which must be from a pre-defined view (for example the standard frontpage view) Quick step guide to getting started: 1. The source code for the Phonegap half of the project can be downloaded from the documentation page or directly from Project moved to which will plug straight into PhonegapBuild Download and install the partner Android app directly at Similar Projects DrupalGapMAG.

Converting a dynamic web site to a PhoneGap application. Earlier today a reader asked me about the possibility of converting his mobile-friendly site into a "real" application via PhoneGap.

Converting a dynamic web site to a PhoneGap application

I told him that this could be very easy. You can take your HTML, upload it to the PhoneGap Builder service, and see what you get. This works with simple HTML sites, but is not going to work well with dynamic sites built with server-side languages. In this blog post, I'll explain why it won't work, and also walk you through an example of converting a (simple) dynamic web site into a PhoneGap application.

Before I begin - two quick notes. First, let's discuss why a dynamic web site can't be simply converted as is into a PhoneGap application. Take for example this simple ColdFusion site. Now - consider PhoneGap. Does this mean you're completely out of luck? First, let's look at the initial application. 01. 02. 04. <! Load JSON data with jQuery, PHP and MySQL. Posted March 2nd, 2010 in Javascript, MySql and PHP (Updated November 18th, 2013) This post shows how to populate a select box based on the value of the another, by getting JSON data with jQuery from a PHP script that gets the data from a MySQL database.

Load JSON data with jQuery, PHP and MySQL

Previous posts As a build up to this post I have recently covered loading JSON data with jQuery, converting an array to JSON with PHP, and fetching data from a MySQL database with PHP PDO using data from my example fruit table. A couple of other relevent posts are how to iterate through an associative array, get and set form element values and adding a new option to a select with jQuery.

Update 18 November 2013 At some point, the jQuery team deprecated the use of .attr() and then removed it altogether, replacing it with .prop(). I have updated this post to use .prop() instead of .attr() and tested it with both 1.10.2 and 2.0.3 in Chrome 31 on OSX Mavericks. Downloadable example. Updated: loading external data into an iOS PhoneGap app using jQuery 1.5.

Update: Following the release of PhoneGap 1.0 and XCode 4 I have updated the Git repository to include a version built with PhoneGap 0.9x (the original version) and a separate version for PhoneGap 1.xx+.

Updated: loading external data into an iOS PhoneGap app using jQuery 1.5

Update: Due to some issues with the recent versions of Cordova I have updated the Git repository to also include a version built with Cordova 1.7.0. My 2010 post about loading data into a PhoneGap application is by far the most viewed page of my blog so I thought I’d revisit it and write an article about a more efficient method I have been using, following the release of jQuery 1.5. Previously I had been using the wonderful JSONp jQuery plugin because jQuery 1.4 and lower did not support out of the box error handlers for JSON requests. jQuery 1.5 does, however, and it’s made things simpler and more streamlined. Sample Application using jQuery Mobile and PhoneGap. Here is a simple application I built using jQuery Mobile and PhoneGap.

Sample Application using jQuery Mobile and PhoneGap

Even though the application is simple, it covers some common requirements of mobile applications: database access through JSON services, multi-level master-detail views, parameter passing between views, etc. You can play with the application here, or download the source code below and build it for different mobile platforms (using the PhoneGap tools or the cloud-based build service at Run the Application. Converting an array to JSON data with PHP. Posted March 1st, 2010 in PHP.

Converting an array to JSON data with PHP

Sample Application using jQuery Mobile and PhoneGap. Tutorial 6: Sending & Receiving External Data : AppFurnace Help & Forums. Stupid PhoneGap Tricks – loading external content. Most PhoneGap apps are built so that the HTML/JS/CSS content is bundled into the app (see my previous blog post).

Stupid PhoneGap Tricks – loading external content

I wondered if it was possible to load external content into the PhoneGap container, and after a few minutes of looking at the APIs, I discovered that it is doable, at least on Android (I’ll try iOS later, but if you are reading this and already know how to do it on iOS, please comment). Simply modify the main Java Class of your PhoneGap Android project and set the loadInWebView property to true – then simply load your content using instead of If you try using without setting the loadInWebView property, it will open the page in the device’s browser and your code won’t have access to the device APIs.

For example: Since the web content is loaded and executed in the PhoneGap container, you can use any PhoneGap JavaScript APIs you desire just as if the code was loaded from the device.