SlideShare a Scribd company logo
PhoneGap
DEVELOPMENT, TESTING,
AND DEBUGGING
By
Dr.T.Abirami
Associate Professor
Department of Information Technology
Kongu Engineering College
Perundurai Erode
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" id="viewport“ content="width=device-width, height=device-
height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script type="text/javascript" charset="utf-8“ src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8">
function onBodyLoad()
{ document.addEventListener("deviceready",onDeviceReady, false); }
function onDeviceReady()
{ navigator.notification.alert("PhoneGap is ready!"); }
</script>
</head>
<body onload="onBodyLoad()">
<h1>HelloWorld2</h1>
<p>This is a sample PhoneGap application.</p>
</body>
</html>
PhoneGap Initialization
PhoneGap Initialization
■ <Head> section of the web page are two new entries:
1. meta tags - describe the content type for the application
2. View port settings - used for the application and how to
scale the content on the screen
- to use the maximum height and width of the screen
- to specify (by the browser) to display the page zoom
level and dimension.
• content = "width = device-width" is used to set the pixel width of the
page or screen device.
• initial-scale = 1 sets the initial zoom level, when the page is loaded
for the first time.
■ <script type="text/javascript" charset="utf-8“
src="phonegap.js"></script>
- loads the PhoneGap API library and makes the
PhoneGap APIs available to the program.
■ <body onload="onBodyLoad()">
- the code registers an event listener that instructs the
application to call the onDeviceReady function when
the device is ready
PhoneGap Initialization
onDeviceReady() event
PhoneGap consists of two code bases:
1. native and
2. JavaScript.
■ While the native code is loading, a custom loading image is
displayed. However, JavaScript is only loaded once the DOM
loads.
■ This means your web application could, potentially, call a
PhoneGap JavaScript function before it is loaded.
■ The PhoneGap deviceready event fires once PhoneGap has
fully loaded. After the device has fired, you can safely make
calls to PhoneGap function.
The PhoneGap Navigator
■ The navigator object contains information about
the browser.
■ update the user interface (UI) with content created
through API calls
■ When an HTML document is loaded into a web
browser, it becomes a document object.
■ The document object is the root node of the HTML
document.
Leveraging PhoneGap APIs
■ Updated the code in the onDeviceReady function
■ the program updates a portion of the application’s content
with an ID of appInfo with information about the device
running the application and the version of PhoneGap
used to build the application.
■ Device-specific information is available via the PhoneGap
device API
■ PhoneGap APIs: inconsistent implementation of an
API across different mobile device platforms. The call
to the device.platform API is supposed to return the
name of the mobile device platform the application is
running on.
Enhancing the User Interface of a
PhoneGap Application
■ to enhance the UI of a PhoneGap application using jQuery Mobile (jQM)
■ jQuery Mobile is a framework for creating mobile web applications.
■ JQuery Mobile is a user interface framework, built on jQuery Core and used
for developing responsive websites or applications that are accessible on
mobile, tablet, and desktop devices.
■ jQuery Mobile uses HTML5 & CSS3 for laying out pages with minimal
scripting.
https://www.quanzhanketang.com/jquerymobile/jquerymobile_intro.html
■ jQM currently supports most of the mobile platforms supported by
PhoneGap.
Why Use jQuery Mobile?
■ It creates web applications that it will work the same way on the
mobile, tablet, and desktop devices.
■ It is compatible with other frameworks such as PhoneGap,
Whitelight, etc.
■ It provides a set of touch-friendly form inputs and UI widgets.
■ The progressive enhancement brings a unique functionality to all
mobile, tablet, and desktop platforms and adds efficient page
loads and wider device support.
Testing and Debugging PhoneGap
Applications
■ Running a PhoneGap Application on a Device Simulator or
Emulator
■ Leveraging PhoneGap Debugging Capabilities
Debugging errors
■ console.log() is a function that writes a message to log on the debugging console,
such as Webkit or Firebug.
■ The console object is an extension to the DOM.
■ The console.log() should be used in code only during development and debugging.
Using the console object, developers can write messages to the browser’s console,
■ console.log("message");
■ console.warn("message");
■ console.error("message");
■ In a browser you will not see anything on the screen. It logs a message to a
debugging console. It is only available in Firefox with Firebug and in Webkit based
browsers (Chrome and Safari). It does not work well in all IE releases.
https://www.w3schools.com/jsref/met_console_log.as
p
Run your app
1. Run on a real mobile device - Connect your device
to your development machine with a USB cable
2. Run on an emulator
T.ABIRAMI/KEC 12
Emulator
■ The emulator is an Virtual Device
(AVD), which represents a specific mobile
device.
■ To execute and test our mobile application on
our PC
■ It provides all the functionality of a real
device.
T.ABIRAMI/KEC 13
Virtual Device (AVD)
■ It is a device configuration that is run with the
emulator.
■ It works with the emulator to provide a virtual
device-specific environment in which to install and
run mobile apps.
T.ABIRAMI/KEC 14
Third-Party PhoneGap Debugging
Tools
■Ripple Mobile Environment
Emulator
■Weinre (Web Inspector Remote)
Ripple Mobile Environment Emulator
■ The Ripple Emulator is a multi-platform mobile device emulator
that runs in a web browser and is custom-tailored to mobile
widget testing.
■ It providing a desktop browser–based interface you can use to
test your PhoneGap applications
■ Tiny Hippos, the company that produced of the Ripple Mobile
Environment Emulator
■ To test BlackBerry WebWorks applications
■ It is implemented as an extension to the Google Chrome
browser
■ It is not designed to replace testing on real devices, device
simulators, or device emulators.
BlackBerry Developers
■ https://developers.blackberry.com/
■ https://developer.blackberry.com/html5/documentation/v1_0/getting_started_with_ripple_1866
966_11.html
Weinre (Web Inspector Remote)
■ WEb INspector REmote was built to enable remote inspection and
debugging of web pages across different devices.
■ For PhoneGap development, it allows a developer to debug a web
application on physical device or a device emulator or simulator.
■ useful tool for debugging web applications.
■ It’s a useful tool, especialy when you need to debug a ”UIWebView”
or Safari on iOS while developing on Linux or Windows.
■ weinre reuses the user interface code from the Web Inspector project
at WebKit so most front-end developers should already be familiar
with the toolbox.
■ to allow you debug web pages on a mobile device such as a phone.
weinre - Home
■https://people.apache.org/~pmuellr/weinr
e/docs/latest/Home.html
■https://developers.google.com/web/tools/
chrome-devtools/remote-debugging
Web Development Tools
■https://developer.apple.com/safari/tools/
Dealing with Cross-Platform
Development Issues
■ API Consistency
– application for platforms that do not
support the particular API
– For most of the PhoneGap APIs, the
documentation lists that the APIs are
supported only on Android, BlackBerry,
and iOS devices
- don’t like to write (or update)
documentation
■ Multiple PhoneGap JavaScript Files
– each platform’s JavaScript file is
different
– to copy over the web content and
then also make sure the correct
PhoneGap JavaScript file was in
the folder.
Dealing with Cross-Platform
Development Issues
■ Web Content Folder Structure - nonstandard
project folder structures for PhoneGap projects.
■ Application Requirements - need to supply
additional files in your application to
accommodate the requirements for a particular
OS version.
Dealing with Cross-Platform
Development Issues
■ Application Navigation and UI - Mobile device platforms
typically share some common elements but at the
same time implement unique features or capabilities
that help set them apart from competitors
■ Application Icons - Each mobile platform and often
different versions of a particular device OS have
different requirements for application icons.
Dealing with Cross-Platform
Development Issues
Build An App
To compile and generate an executable file for
different platforms.
Following are the ways which you can use to build an
app.
■ Build An App Using PhoneGap Build
– By uploading a zip file
– Using GIT
■ Build An App Using CLI
https://build.phonegap.com/
Build An App Using PhoneGap
Build:
■ PhoneGap Build is a cloud service used to build apps
online.
■ All you have to do is to upload the project to PhoneGap Build
and it will create an executable file of apps for different
platforms.
It will generate:
■ APK for Android (Android Package)
■ IPA for IOS (iPhone application archive file )
■ XAP for Windows :Microsoft Cross-Platform Audio Creation
Tool (XACT) / (eXtensible Ajax Platform)
Steps
1. Open ‘PhoneGap Build‘ and sign up.
2. Log into the PhoneGap Build Account.
Now you have 2 ways to upload a project:
By Using GIT
■ You can keep your app open source or private. PhoneGap
Build has different plans for private apps.
■ You need to upload your project on GitHub and copy the link
of that repository and paste it here.
■ Now click on ‘Pull from .git repository‘. Your project will be
uploaded.
By Uploading A ZIP File
■ Click on the ‘private’ tab.
References
■ https://cordova.apache.org/docs/en/latest/cord
ova/events/events.html#deviceready
What is an API?
(Application Programming Interface)
■ It is a software intermediary that allows two applications to talk to each
other.
■ It is a software-to-software interface that enables two applications to
exchange data among each other.
■ The PhoneGap Build API allows applications to use the PhoneGap Build
web service to create, build, update, and download PhoneGap apps.
■ PhoneGap is defined as an API used for accessing the native mobile
resources that enables the developers to create mobile applications using
the standard web technologies.
For example:
■ Each time you use an app like Facebook, send an instant message, or
check the weather on your phone, you’re using an API.
Document Object Model (DOM)
■ It is an application programming interface (API) for HTML
and XML documents.
■ When a web page is loaded, the browser creates
a Document Object Model of the page.
■ It defines the logical structure of documents and the way
a document is accessed and manipulated.
https://www.w3schools.com/js/js_htmldom_events.asp
addEventListener() method Syntax
element.addEventListener(event, function, useCapture);
■ The first parameter is the type of the event (like "click" or
"mousedown" or any other HTML DOM Event.)
■ The second parameter is the function we want to call when the
event occurs.
■ The third parameter is a boolean value specifying whether to use
event bubbling or event capturing. This parameter is optional.
Note that you don't use the "on" prefix for the event; use "click"
instead of "onclick".
document.addEventListener("deviceready",onDeviceReady, false);
https://www.w3schools.com/js/js_htmldom_eventlistener.asp
Step 1: Install PhoneGap
■ http://docs.phonegap.com/getting-started/1-install-phonegap/desktop
Step 2: Install PhoneGap
 The PhoneGap Developer App is a mobile app that runs on devices
and allows you to preview and test the PhoneGap mobile apps you
build across platforms without additional platform SDK setup.
 It automatically provides access to the PhoneGap core APIs providing
instant access to the native device features without having to install
any plugins or compile anything locally.
 It's meant to provide an easy way for developers to get started creating
and testing their PhoneGap applications quickly with minimal setup.
 Locate the free PhoneGap Developer app from one of the following
supported app marketplaces and install it to your mobile device:
• Google Play
• Windows Phone Store
• ~iTunes~ Currently not available but you can still build it yourself!
Create Your App
http://docs.phonegap.com/getting-started/3-create-your-
app/desktop/
Run Your App
green play button to be
highlighted and a green
bar showing the server
address it's running on
at the bottom of the
PhoneGap Desktop.
Go to your mobile device
where the PhoneGap
Developer App is running,
enter the server address on
the main screen and
tap Connect.
You should see the
connection occur followed by
a success message as shown
below. If you receive an error
of any kind, ensure once
again that you are connected
to the same network on both
your device and computer.
Ad

More Related Content

What's hot (19)

Apps with Apache Cordova and Phonegap
Apps with Apache Cordova and PhonegapApps with Apache Cordova and Phonegap
Apps with Apache Cordova and Phonegap
Christian Grobmeier
 
Talk (2)
Talk (2)Talk (2)
Talk (2)
suraj sakhardande
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment ppt
sagaroceanic11
 
Hybrid App Development with PhoneGap
Hybrid App Development with PhoneGapHybrid App Development with PhoneGap
Hybrid App Development with PhoneGap
Dotitude
 
Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)
Nicholas Jansma
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
Ryan Stewart
 
Samsung Indonesia: Tizen Wearables
Samsung Indonesia: Tizen WearablesSamsung Indonesia: Tizen Wearables
Samsung Indonesia: Tizen Wearables
Ryo Jin
 
TiCalabash: Fully automated Acceptance Testing @ TiConf EU 2014
TiCalabash: Fully automated Acceptance Testing @ TiConf EU 2014TiCalabash: Fully automated Acceptance Testing @ TiConf EU 2014
TiCalabash: Fully automated Acceptance Testing @ TiConf EU 2014
Andrew McElroy
 
Wikipedia Mobile App with PhoneGap
Wikipedia Mobile App with PhoneGapWikipedia Mobile App with PhoneGap
Wikipedia Mobile App with PhoneGap
Ted Chien
 
TiConf EU 2014
TiConf EU 2014TiConf EU 2014
TiConf EU 2014
Ingo Muschenetz
 
Rapid Prototyping with Cordova aka Phonegap
Rapid Prototyping with Cordova aka PhonegapRapid Prototyping with Cordova aka Phonegap
Rapid Prototyping with Cordova aka Phonegap
Josue Bustos
 
Cordova and PhoneGap Insights
Cordova and PhoneGap InsightsCordova and PhoneGap Insights
Cordova and PhoneGap Insights
Monaca
 
Phonegap/Cordova vs Native Application
Phonegap/Cordova vs Native ApplicationPhonegap/Cordova vs Native Application
Phonegap/Cordova vs Native Application
Muhammad Hakim A
 
Windows Phone Programming
Windows Phone ProgrammingWindows Phone Programming
Windows Phone Programming
Pasi Manninen
 
Building Cross-Platform JavaScript Apps using Cordova
Building Cross-Platform JavaScript Apps using CordovaBuilding Cross-Platform JavaScript Apps using Cordova
Building Cross-Platform JavaScript Apps using Cordova
Noam Kfir
 
Getting Started with Titanium
Getting Started with TitaniumGetting Started with Titanium
Getting Started with Titanium
Kevin Whinnery
 
Adobe Flash Platform for Mobile Development
Adobe Flash Platform for Mobile DevelopmentAdobe Flash Platform for Mobile Development
Adobe Flash Platform for Mobile Development
IndicThreads
 
Automated UI Testing for Web and Native Apps on iOS and Android
Automated UI Testing for  Web and Native Apps on iOS and AndroidAutomated UI Testing for  Web and Native Apps on iOS and Android
Automated UI Testing for Web and Native Apps on iOS and Android
Operation Mobile
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
degarden
 
Apps with Apache Cordova and Phonegap
Apps with Apache Cordova and PhonegapApps with Apache Cordova and Phonegap
Apps with Apache Cordova and Phonegap
Christian Grobmeier
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment ppt
sagaroceanic11
 
Hybrid App Development with PhoneGap
Hybrid App Development with PhoneGapHybrid App Development with PhoneGap
Hybrid App Development with PhoneGap
Dotitude
 
Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)
Nicholas Jansma
 
Samsung Indonesia: Tizen Wearables
Samsung Indonesia: Tizen WearablesSamsung Indonesia: Tizen Wearables
Samsung Indonesia: Tizen Wearables
Ryo Jin
 
TiCalabash: Fully automated Acceptance Testing @ TiConf EU 2014
TiCalabash: Fully automated Acceptance Testing @ TiConf EU 2014TiCalabash: Fully automated Acceptance Testing @ TiConf EU 2014
TiCalabash: Fully automated Acceptance Testing @ TiConf EU 2014
Andrew McElroy
 
Wikipedia Mobile App with PhoneGap
Wikipedia Mobile App with PhoneGapWikipedia Mobile App with PhoneGap
Wikipedia Mobile App with PhoneGap
Ted Chien
 
Rapid Prototyping with Cordova aka Phonegap
Rapid Prototyping with Cordova aka PhonegapRapid Prototyping with Cordova aka Phonegap
Rapid Prototyping with Cordova aka Phonegap
Josue Bustos
 
Cordova and PhoneGap Insights
Cordova and PhoneGap InsightsCordova and PhoneGap Insights
Cordova and PhoneGap Insights
Monaca
 
Phonegap/Cordova vs Native Application
Phonegap/Cordova vs Native ApplicationPhonegap/Cordova vs Native Application
Phonegap/Cordova vs Native Application
Muhammad Hakim A
 
Windows Phone Programming
Windows Phone ProgrammingWindows Phone Programming
Windows Phone Programming
Pasi Manninen
 
Building Cross-Platform JavaScript Apps using Cordova
Building Cross-Platform JavaScript Apps using CordovaBuilding Cross-Platform JavaScript Apps using Cordova
Building Cross-Platform JavaScript Apps using Cordova
Noam Kfir
 
Getting Started with Titanium
Getting Started with TitaniumGetting Started with Titanium
Getting Started with Titanium
Kevin Whinnery
 
Adobe Flash Platform for Mobile Development
Adobe Flash Platform for Mobile DevelopmentAdobe Flash Platform for Mobile Development
Adobe Flash Platform for Mobile Development
IndicThreads
 
Automated UI Testing for Web and Native Apps on iOS and Android
Automated UI Testing for  Web and Native Apps on iOS and AndroidAutomated UI Testing for  Web and Native Apps on iOS and Android
Automated UI Testing for Web and Native Apps on iOS and Android
Operation Mobile
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
degarden
 

Similar to Phone gap development, testing, and debugging (20)

Introduction phonegap
Introduction phonegapIntroduction phonegap
Introduction phonegap
Rakesh Jha
 
Advanced programing in phonegap
Advanced programing in phonegapAdvanced programing in phonegap
Advanced programing in phonegap
Rakesh Jha
 
phonegap_101
phonegap_101phonegap_101
phonegap_101
Asanka Indrajith
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
Jussi Pohjolainen
 
Phonegap Development & Debugging
Phonegap Development & DebuggingPhonegap Development & Debugging
Phonegap Development & Debugging
Ivano Malavolta
 
"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGap"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGap
Christian Rokitta
 
Hybridmobileapps 130130213844-phpapp02
Hybridmobileapps 130130213844-phpapp02Hybridmobileapps 130130213844-phpapp02
Hybridmobileapps 130130213844-phpapp02
weeyee
 
Phonegap android
Phonegap androidPhonegap android
Phonegap android
umesh patil
 
Apache cordova
Apache cordovaApache cordova
Apache cordova
Carlo Bernaschina
 
Phone gap
Phone gapPhone gap
Phone gap
Ali Dany
 
Getting started with PhoneGap
Getting started with PhoneGapGetting started with PhoneGap
Getting started with PhoneGap
Mihai Corlan
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile Apps
John M. Wargo
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App Development
Annmarie Lanesey
 
HTML5 Can't Do That
HTML5 Can't Do ThatHTML5 Can't Do That
HTML5 Can't Do That
Nathan Smith
 
PhoneGap JavaScript API vs Native Components
PhoneGap JavaScript API vs Native ComponentsPhoneGap JavaScript API vs Native Components
PhoneGap JavaScript API vs Native Components
TechAhead
 
Mobile Application Development class 001
Mobile Application Development class 001Mobile Application Development class 001
Mobile Application Development class 001
Dr. Mazin Mohamed alkathiri
 
Build Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGapBuild Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGap
Allan Huang
 
Hybridapp
HybridappHybridapp
Hybridapp
Faizaan Ahmed Khan
 
PhoneGap/PhoneGap Build - Amsterdam Adobe Camp
PhoneGap/PhoneGap Build - Amsterdam Adobe CampPhoneGap/PhoneGap Build - Amsterdam Adobe Camp
PhoneGap/PhoneGap Build - Amsterdam Adobe Camp
Mihai Corlan
 
PhoneGap/Cordova
PhoneGap/CordovaPhoneGap/Cordova
PhoneGap/Cordova
Mihai Corlan
 
Introduction phonegap
Introduction phonegapIntroduction phonegap
Introduction phonegap
Rakesh Jha
 
Advanced programing in phonegap
Advanced programing in phonegapAdvanced programing in phonegap
Advanced programing in phonegap
Rakesh Jha
 
Phonegap Development & Debugging
Phonegap Development & DebuggingPhonegap Development & Debugging
Phonegap Development & Debugging
Ivano Malavolta
 
"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGap"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGap
Christian Rokitta
 
Hybridmobileapps 130130213844-phpapp02
Hybridmobileapps 130130213844-phpapp02Hybridmobileapps 130130213844-phpapp02
Hybridmobileapps 130130213844-phpapp02
weeyee
 
Phonegap android
Phonegap androidPhonegap android
Phonegap android
umesh patil
 
Getting started with PhoneGap
Getting started with PhoneGapGetting started with PhoneGap
Getting started with PhoneGap
Mihai Corlan
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile Apps
John M. Wargo
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App Development
Annmarie Lanesey
 
HTML5 Can't Do That
HTML5 Can't Do ThatHTML5 Can't Do That
HTML5 Can't Do That
Nathan Smith
 
PhoneGap JavaScript API vs Native Components
PhoneGap JavaScript API vs Native ComponentsPhoneGap JavaScript API vs Native Components
PhoneGap JavaScript API vs Native Components
TechAhead
 
Build Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGapBuild Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGap
Allan Huang
 
PhoneGap/PhoneGap Build - Amsterdam Adobe Camp
PhoneGap/PhoneGap Build - Amsterdam Adobe CampPhoneGap/PhoneGap Build - Amsterdam Adobe Camp
PhoneGap/PhoneGap Build - Amsterdam Adobe Camp
Mihai Corlan
 
Ad

More from Kongu Engineering College, Perundurai, Erode (20)

Introduction to Generative AI refers to a subset of artificial intelligence
Introduction to Generative AI refers to a subset of artificial intelligenceIntroduction to Generative AI refers to a subset of artificial intelligence
Introduction to Generative AI refers to a subset of artificial intelligence
Kongu Engineering College, Perundurai, Erode
 
Introduction to Microsoft Power BI is a business analytics service
Introduction to Microsoft Power BI is a business analytics serviceIntroduction to Microsoft Power BI is a business analytics service
Introduction to Microsoft Power BI is a business analytics service
Kongu Engineering College, Perundurai, Erode
 
Connect to NoSQL Database (MongoDB) using Node JS & Connect Node.js with NoSQ...
Connect to NoSQL Database (MongoDB) using Node JS & Connect Node.js with NoSQ...Connect to NoSQL Database (MongoDB) using Node JS & Connect Node.js with NoSQ...
Connect to NoSQL Database (MongoDB) using Node JS & Connect Node.js with NoSQ...
Kongu Engineering College, Perundurai, Erode
 
concept of server-side JavaScript / JS Framework: NODEJS
concept of server-side JavaScript / JS Framework: NODEJSconcept of server-side JavaScript / JS Framework: NODEJS
concept of server-side JavaScript / JS Framework: NODEJS
Kongu Engineering College, Perundurai, Erode
 
Node.js web-based Example :Run a local server in order to start using node.js...
Node.js web-based Example :Run a local server in order to start using node.js...Node.js web-based Example :Run a local server in order to start using node.js...
Node.js web-based Example :Run a local server in order to start using node.js...
Kongu Engineering College, Perundurai, Erode
 
Concepts of Satellite Communication and types and its applications
Concepts of Satellite Communication  and types and its applicationsConcepts of Satellite Communication  and types and its applications
Concepts of Satellite Communication and types and its applications
Kongu Engineering College, Perundurai, Erode
 
Concepts of Mobile Communication Wireless LANs, Bluetooth , HiperLAN
Concepts of Mobile Communication Wireless LANs, Bluetooth , HiperLANConcepts of Mobile Communication Wireless LANs, Bluetooth , HiperLAN
Concepts of Mobile Communication Wireless LANs, Bluetooth , HiperLAN
Kongu Engineering College, Perundurai, Erode
 
Web Technology Introduction framework.pptx
Web Technology Introduction framework.pptxWeb Technology Introduction framework.pptx
Web Technology Introduction framework.pptx
Kongu Engineering College, Perundurai, Erode
 
Computer Network - Unicast Routing Distance vector Link state vector
Computer Network - Unicast Routing Distance vector Link state vectorComputer Network - Unicast Routing Distance vector Link state vector
Computer Network - Unicast Routing Distance vector Link state vector
Kongu Engineering College, Perundurai, Erode
 
Android SQLite database oriented application development
Android SQLite database oriented application developmentAndroid SQLite database oriented application development
Android SQLite database oriented application development
Kongu Engineering College, Perundurai, Erode
 
Android Application Development Programming
Android Application Development ProgrammingAndroid Application Development Programming
Android Application Development Programming
Kongu Engineering College, Perundurai, Erode
 
Introduction to Spring & Spring BootFramework
Introduction to Spring  & Spring BootFrameworkIntroduction to Spring  & Spring BootFramework
Introduction to Spring & Spring BootFramework
Kongu Engineering College, Perundurai, Erode
 
A REST API (also called a RESTful API or RESTful web API) is an application p...
A REST API (also called a RESTful API or RESTful web API) is an application p...A REST API (also called a RESTful API or RESTful web API) is an application p...
A REST API (also called a RESTful API or RESTful web API) is an application p...
Kongu Engineering College, Perundurai, Erode
 
SOA and Monolith Architecture - Micro Services.pptx
SOA and Monolith Architecture - Micro Services.pptxSOA and Monolith Architecture - Micro Services.pptx
SOA and Monolith Architecture - Micro Services.pptx
Kongu Engineering College, Perundurai, Erode
 
Application Layer.pptx
Application Layer.pptxApplication Layer.pptx
Application Layer.pptx
Kongu Engineering College, Perundurai, Erode
 
Connect to NoSQL Database using Node JS.pptx
Connect to NoSQL Database using Node JS.pptxConnect to NoSQL Database using Node JS.pptx
Connect to NoSQL Database using Node JS.pptx
Kongu Engineering College, Perundurai, Erode
 
Node_basics.pptx
Node_basics.pptxNode_basics.pptx
Node_basics.pptx
Kongu Engineering College, Perundurai, Erode
 
Navigation Bar.pptx
Navigation Bar.pptxNavigation Bar.pptx
Navigation Bar.pptx
Kongu Engineering College, Perundurai, Erode
 
Bootstarp installation.pptx
Bootstarp installation.pptxBootstarp installation.pptx
Bootstarp installation.pptx
Kongu Engineering College, Perundurai, Erode
 
nested_Object as Parameter & Recursion_Later_commamd.pptx
nested_Object as Parameter  & Recursion_Later_commamd.pptxnested_Object as Parameter  & Recursion_Later_commamd.pptx
nested_Object as Parameter & Recursion_Later_commamd.pptx
Kongu Engineering College, Perundurai, Erode
 
Ad

Recently uploaded (20)

Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Journal of Soft Computing in Civil Engineering
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 

Phone gap development, testing, and debugging

  • 1. PhoneGap DEVELOPMENT, TESTING, AND DEBUGGING By Dr.T.Abirami Associate Professor Department of Information Technology Kongu Engineering College Perundurai Erode
  • 2. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <meta name="viewport" id="viewport“ content="width=device-width, height=device- height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <script type="text/javascript" charset="utf-8“ src="phonegap.js"></script> <script type="text/javascript" charset="utf-8"> function onBodyLoad() { document.addEventListener("deviceready",onDeviceReady, false); } function onDeviceReady() { navigator.notification.alert("PhoneGap is ready!"); } </script> </head> <body onload="onBodyLoad()"> <h1>HelloWorld2</h1> <p>This is a sample PhoneGap application.</p> </body> </html> PhoneGap Initialization
  • 3. PhoneGap Initialization ■ <Head> section of the web page are two new entries: 1. meta tags - describe the content type for the application 2. View port settings - used for the application and how to scale the content on the screen - to use the maximum height and width of the screen - to specify (by the browser) to display the page zoom level and dimension. • content = "width = device-width" is used to set the pixel width of the page or screen device. • initial-scale = 1 sets the initial zoom level, when the page is loaded for the first time.
  • 4. ■ <script type="text/javascript" charset="utf-8“ src="phonegap.js"></script> - loads the PhoneGap API library and makes the PhoneGap APIs available to the program. ■ <body onload="onBodyLoad()"> - the code registers an event listener that instructs the application to call the onDeviceReady function when the device is ready PhoneGap Initialization
  • 5. onDeviceReady() event PhoneGap consists of two code bases: 1. native and 2. JavaScript. ■ While the native code is loading, a custom loading image is displayed. However, JavaScript is only loaded once the DOM loads. ■ This means your web application could, potentially, call a PhoneGap JavaScript function before it is loaded. ■ The PhoneGap deviceready event fires once PhoneGap has fully loaded. After the device has fired, you can safely make calls to PhoneGap function.
  • 6. The PhoneGap Navigator ■ The navigator object contains information about the browser. ■ update the user interface (UI) with content created through API calls ■ When an HTML document is loaded into a web browser, it becomes a document object. ■ The document object is the root node of the HTML document.
  • 7. Leveraging PhoneGap APIs ■ Updated the code in the onDeviceReady function ■ the program updates a portion of the application’s content with an ID of appInfo with information about the device running the application and the version of PhoneGap used to build the application. ■ Device-specific information is available via the PhoneGap device API ■ PhoneGap APIs: inconsistent implementation of an API across different mobile device platforms. The call to the device.platform API is supposed to return the name of the mobile device platform the application is running on.
  • 8. Enhancing the User Interface of a PhoneGap Application ■ to enhance the UI of a PhoneGap application using jQuery Mobile (jQM) ■ jQuery Mobile is a framework for creating mobile web applications. ■ JQuery Mobile is a user interface framework, built on jQuery Core and used for developing responsive websites or applications that are accessible on mobile, tablet, and desktop devices. ■ jQuery Mobile uses HTML5 & CSS3 for laying out pages with minimal scripting. https://www.quanzhanketang.com/jquerymobile/jquerymobile_intro.html ■ jQM currently supports most of the mobile platforms supported by PhoneGap.
  • 9. Why Use jQuery Mobile? ■ It creates web applications that it will work the same way on the mobile, tablet, and desktop devices. ■ It is compatible with other frameworks such as PhoneGap, Whitelight, etc. ■ It provides a set of touch-friendly form inputs and UI widgets. ■ The progressive enhancement brings a unique functionality to all mobile, tablet, and desktop platforms and adds efficient page loads and wider device support.
  • 10. Testing and Debugging PhoneGap Applications ■ Running a PhoneGap Application on a Device Simulator or Emulator ■ Leveraging PhoneGap Debugging Capabilities
  • 11. Debugging errors ■ console.log() is a function that writes a message to log on the debugging console, such as Webkit or Firebug. ■ The console object is an extension to the DOM. ■ The console.log() should be used in code only during development and debugging. Using the console object, developers can write messages to the browser’s console, ■ console.log("message"); ■ console.warn("message"); ■ console.error("message"); ■ In a browser you will not see anything on the screen. It logs a message to a debugging console. It is only available in Firefox with Firebug and in Webkit based browsers (Chrome and Safari). It does not work well in all IE releases. https://www.w3schools.com/jsref/met_console_log.as p
  • 12. Run your app 1. Run on a real mobile device - Connect your device to your development machine with a USB cable 2. Run on an emulator T.ABIRAMI/KEC 12
  • 13. Emulator ■ The emulator is an Virtual Device (AVD), which represents a specific mobile device. ■ To execute and test our mobile application on our PC ■ It provides all the functionality of a real device. T.ABIRAMI/KEC 13
  • 14. Virtual Device (AVD) ■ It is a device configuration that is run with the emulator. ■ It works with the emulator to provide a virtual device-specific environment in which to install and run mobile apps. T.ABIRAMI/KEC 14
  • 15. Third-Party PhoneGap Debugging Tools ■Ripple Mobile Environment Emulator ■Weinre (Web Inspector Remote)
  • 16. Ripple Mobile Environment Emulator ■ The Ripple Emulator is a multi-platform mobile device emulator that runs in a web browser and is custom-tailored to mobile widget testing. ■ It providing a desktop browser–based interface you can use to test your PhoneGap applications ■ Tiny Hippos, the company that produced of the Ripple Mobile Environment Emulator ■ To test BlackBerry WebWorks applications ■ It is implemented as an extension to the Google Chrome browser ■ It is not designed to replace testing on real devices, device simulators, or device emulators.
  • 17. BlackBerry Developers ■ https://developers.blackberry.com/ ■ https://developer.blackberry.com/html5/documentation/v1_0/getting_started_with_ripple_1866 966_11.html
  • 18. Weinre (Web Inspector Remote) ■ WEb INspector REmote was built to enable remote inspection and debugging of web pages across different devices. ■ For PhoneGap development, it allows a developer to debug a web application on physical device or a device emulator or simulator. ■ useful tool for debugging web applications. ■ It’s a useful tool, especialy when you need to debug a ”UIWebView” or Safari on iOS while developing on Linux or Windows. ■ weinre reuses the user interface code from the Web Inspector project at WebKit so most front-end developers should already be familiar with the toolbox. ■ to allow you debug web pages on a mobile device such as a phone.
  • 21. Dealing with Cross-Platform Development Issues ■ API Consistency – application for platforms that do not support the particular API – For most of the PhoneGap APIs, the documentation lists that the APIs are supported only on Android, BlackBerry, and iOS devices - don’t like to write (or update) documentation
  • 22. ■ Multiple PhoneGap JavaScript Files – each platform’s JavaScript file is different – to copy over the web content and then also make sure the correct PhoneGap JavaScript file was in the folder. Dealing with Cross-Platform Development Issues
  • 23. ■ Web Content Folder Structure - nonstandard project folder structures for PhoneGap projects. ■ Application Requirements - need to supply additional files in your application to accommodate the requirements for a particular OS version. Dealing with Cross-Platform Development Issues
  • 24. ■ Application Navigation and UI - Mobile device platforms typically share some common elements but at the same time implement unique features or capabilities that help set them apart from competitors ■ Application Icons - Each mobile platform and often different versions of a particular device OS have different requirements for application icons. Dealing with Cross-Platform Development Issues
  • 25. Build An App To compile and generate an executable file for different platforms. Following are the ways which you can use to build an app. ■ Build An App Using PhoneGap Build – By uploading a zip file – Using GIT ■ Build An App Using CLI https://build.phonegap.com/
  • 26. Build An App Using PhoneGap Build: ■ PhoneGap Build is a cloud service used to build apps online. ■ All you have to do is to upload the project to PhoneGap Build and it will create an executable file of apps for different platforms. It will generate: ■ APK for Android (Android Package) ■ IPA for IOS (iPhone application archive file ) ■ XAP for Windows :Microsoft Cross-Platform Audio Creation Tool (XACT) / (eXtensible Ajax Platform)
  • 27. Steps 1. Open ‘PhoneGap Build‘ and sign up. 2. Log into the PhoneGap Build Account. Now you have 2 ways to upload a project: By Using GIT ■ You can keep your app open source or private. PhoneGap Build has different plans for private apps. ■ You need to upload your project on GitHub and copy the link of that repository and paste it here. ■ Now click on ‘Pull from .git repository‘. Your project will be uploaded. By Uploading A ZIP File ■ Click on the ‘private’ tab.
  • 29. What is an API? (Application Programming Interface) ■ It is a software intermediary that allows two applications to talk to each other. ■ It is a software-to-software interface that enables two applications to exchange data among each other. ■ The PhoneGap Build API allows applications to use the PhoneGap Build web service to create, build, update, and download PhoneGap apps. ■ PhoneGap is defined as an API used for accessing the native mobile resources that enables the developers to create mobile applications using the standard web technologies. For example: ■ Each time you use an app like Facebook, send an instant message, or check the weather on your phone, you’re using an API.
  • 30. Document Object Model (DOM) ■ It is an application programming interface (API) for HTML and XML documents. ■ When a web page is loaded, the browser creates a Document Object Model of the page. ■ It defines the logical structure of documents and the way a document is accessed and manipulated. https://www.w3schools.com/js/js_htmldom_events.asp
  • 31. addEventListener() method Syntax element.addEventListener(event, function, useCapture); ■ The first parameter is the type of the event (like "click" or "mousedown" or any other HTML DOM Event.) ■ The second parameter is the function we want to call when the event occurs. ■ The third parameter is a boolean value specifying whether to use event bubbling or event capturing. This parameter is optional. Note that you don't use the "on" prefix for the event; use "click" instead of "onclick". document.addEventListener("deviceready",onDeviceReady, false); https://www.w3schools.com/js/js_htmldom_eventlistener.asp
  • 32. Step 1: Install PhoneGap ■ http://docs.phonegap.com/getting-started/1-install-phonegap/desktop Step 2: Install PhoneGap  The PhoneGap Developer App is a mobile app that runs on devices and allows you to preview and test the PhoneGap mobile apps you build across platforms without additional platform SDK setup.  It automatically provides access to the PhoneGap core APIs providing instant access to the native device features without having to install any plugins or compile anything locally.  It's meant to provide an easy way for developers to get started creating and testing their PhoneGap applications quickly with minimal setup.  Locate the free PhoneGap Developer app from one of the following supported app marketplaces and install it to your mobile device: • Google Play • Windows Phone Store • ~iTunes~ Currently not available but you can still build it yourself!
  • 34. Run Your App green play button to be highlighted and a green bar showing the server address it's running on at the bottom of the PhoneGap Desktop. Go to your mobile device where the PhoneGap Developer App is running, enter the server address on the main screen and tap Connect. You should see the connection occur followed by a success message as shown below. If you receive an error of any kind, ensure once again that you are connected to the same network on both your device and computer.