16.11.2015 Views

PG2

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

32 Chapter 2 PhoneGap Development, Testing, and Debugging<br />

src="phonegap.js"><br />

<br />

function onBodyLoad() {<br />

document.addEventListener("deviceready", onDeviceReady,<br />

false);<br />

}<br />

function onDeviceReady() {<br />

//Get the appInfo DOM element<br />

var element = document.getElementById('appInfo');<br />

//replace it with specific information about the device<br />

//running the application<br />

element.innerHTML = 'PhoneGap (version ' +<br />

device.phonegap + ')' + device.platform + ' ' +<br />

device.name + ' (version ' + device.version + ').';<br />

}<br />

<br />

<br />

<br />

<br />

<br />

HelloWorld4<br />

<br />

<br />

This is a PhoneGap application that makes calls to<br />

the PhoneGap APIs and uses the jQuery Mobile<br />

framework.<br />

Waiting for PhoneGap Initialization to<br />

complete<br />

<br />

<br />

PhoneGap Essentials<br />

<br />

<br />

<br />

<br />

Figure 2-4 shows the application running on the Android simulator.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!