SlideShare a Scribd company logo
1 of 23
Mobile App Development using
Dss Prakash
Agenda
• Why cross platform for mobile development .
• What is PhoneGAP ?
• How does phonegap work..?
• PhoneGap features.
• Setting-up Your PhoneGap Environment.
• Creating “Hello World!” using PhoneGap.
• PhoneGap Plugin development
Dss Prakash
Cross-Platform Mobile Apps
• Design & Build the mobile app using HTML5,CSS3 & JavaScript
• Bind up with Adobe PhoneGap
-> Free Cordova open source framework or PhoneGap build.
-> Get access to native API’s (Accelerometer, Camera,
Compass, Device, Events, File, Geolocation, Media, etc. )
• Deploy to multiple platforms
-> iOS ,Android ,Windows Phone ,Blackberry ,Symbian etc. )
• Multiple Cordova variants availble
-> Telrik App Builder, IBM work light ,HP Anywhare etc.
Dss Prakash
1. PhoneGap is still a product of Adobe. It is a distribution of
Apache Cordova.
Think of Apache Cordova as the engine that powers
PhoneGap.
Dss Prakash
Apache Cordova
• Apache Cordova is a platform for building
natively installed mobile applications
using HTML, CSS and JavaScript
Dss Prakash
What is PhoneGap?
• Build mobile apps using HTML5, Javascript & CSS3
• PhoneGap was originally developed by Nitobi
• In 2011, Adobe acquired Nitobi
• PhoneGap was donated to the Apache Software Foundation
(ASF) under the name Apache Cordova
• Through the ASF, PhoneGap remains free and open source
under the Apache License, Version 2.0
• PhoneGap adds extra features to Cordova (e.g. cloud build)
• http://cordova.apache.org/
• http://phonegap.com/
Dss Prakash
Installing PhoneGap
C:> npm install -g phonegap
$ phonegap create my-app
$ cd my-app
$ phonegap run android
To Install, ensure that you have NodeJS installed, then open your command-line and
run the following:
Install
Usage
PhoneGap Architecture
Dss Prakash
How does PhoneGap Work?
• Include web code in a native app project:
- assets/www/js/, css/, images/, etc.
• Native code loads a URL to the web code through
the device’s internal browser:
- Extend a CordovaWebViewClient
- super.loadUrl( “file:///android_asset/www/login.html” );
• Apache Cordova exposes native device APIs
through JavaScript:
- navigator.device.capture.captureImage( captureSuccess(),
captureError(), [options] );
Dss Prakash
API’s In PhoneGAP
Dss Prakash
1. HTML5 and CCS 3 support.
2. Debugging and profiling .
3. Performance and memory usage.
4. Screen size and orientation .
5. DPI’s .(Dots per inch (dpi) is
a measure of a display's pixel density).
6. User interface – or use just native look.
7. Performance and optimization
Challenges in PhoneGap ..?
1. PhoneGap is not UI framework .
2. PhoneGap doesn't include a browser
and /or rendering engine.
3. PhoneGap doesn't compile .
4. Every platform needs its own compilation.
5. HTML5/CSS3 compatibility.
What is NOT PhoneGap ..?
Creating “Hello World” !
• Creating the Android Project and create a activity extending to
DroidGap
• Add ‘phonegap.jar’ to libs folder <project>/libs
• Add ‘phonegap.jar’ to java build path
• Add the config.xml file located inside xml folder required for
phone gap. Paste the entire xml folder inside res folder
• Add the required permissions to AndroidMainfeast.xml folder
• Creating the HTML (index.html) file and put in assets/www
folder
• Create and start AVD. Run the Application .
Dss Prakash
Dss Prakash
Html Code ..!
Dss Prakash
<!DOCTYPE html>
<html>
<head>
<title>Device Properties Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for Cordova to load
document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready
function onDeviceReady() {
navigator.geolocation.getCurrentPosition(onSuccess, onError);
}
// onSuccess Geolocation
function onSuccess(position) {
var element = document.getElementById('geolocation');
element.innerHTML = 'Latitude: ' + position.coords.latitude + '<br />' +
'Longitude: ' + position.coords.longitude + '<br />' +
'Altitude: ' + position.coords.altitude + '<br />' +
'Accuracy: ' + position.coords.accuracy + '<br />' +
'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '<br />' +
}
// onError Callback receives a PositionError object
function onError(error) {
alert('code: ' + error.code + 'n' + message: ' + error.message + 'n');
}
</script>
</head>
<body>
<p id="geolocation">Finding geolocation...</p>
</body>
</html>
<!DOCTYPE html>
<html ng-app="myApps">
<head>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>PhoneGap Plugins Example</title>
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
<script type="text/javascript" src="cordova.js"></script>
<script src="js/myApp.js"></script>
<script src="js/controller.js"></script>
</head>
<body><div ng-controller="controller">
<div>
<h1>PhoneGap Plugins Example</h1>
</div>
<p><button class="myButton" ng-click="alertDeviceInfo()">Device</button></p>
<p><button class="myButton" ng-click="alertGeoLocation()">Location</button></p>
<p><button class="myButton" ng-click="beepNotify()">Beep</button></p>
<p><button class="myButton" ng-click="vibrateNotify()">Vibrate</button></p>
</div>
<div>
<a class="myButton" href="Gmap.html">Map</a>
</div>
<script type="text/javascript"> app.initialize();
</script>
</body>
</html>
Index.html
myApp.controller("controller", function($scope){
// Fetch Device info from Device Plugin
$scope.alertDeviceInfo = function() {
var deviceInfo = ('Device Platform: ' + device.platform + 'n'
+ 'Device Version: ' + device.version + 'n' + 'Device Model: '
+ device.model + 'n' + 'Device UUID: ' + device.uuid + 'n');
navigator.notification.alert(deviceInfo);
};
// Fetch location info from GeoLocation Plugin
$scope.alertGeoLocation = function() {
var onSuccess = function(position) {
navigator.notification.alert('Latitude: '
+ position.coords.latitude + 'n' + 'Longitude: '
+ position.coords.longitude + 'n' + 'Altitude: '
+ position.coords.altitude + 'n' + 'Accuracy: '
+ position.coords.accuracy + 'n' + 'Altitude Accuracy: '
+ position.coords.altitudeAccuracy + 'n' + 'Heading: '
+ position.coords.heading + 'n' + 'Timestamp: '
+ position.timestamp + 'n');
};
navigator.geolocation.getCurrentPosition(onSuccess);
};
// Makes a beep sound
$scope.beepNotify = function() {
navigator.notification.beep(1);
};
// Vibrates the phone
$scope.vibrateNotify = function() {
navigator.notification.vibrate(1000);
};
});
Controller.js
var app = {
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicity call 'app.receivedEvent(...);'
onDeviceReady: function() {
app.receivedEvent('deviceready');
},
// Update DOM on a Received Event
receivedEvent: function(id) {
console.log('Received Event: ' + id);
}
};
var myApp = angular.module('myApps', []);
Index.js
myApp.js
PhoneGAP Advantages..!
• Not required any programming language
• Supportive for all major platforms
• Support for Various API’s
Dss Prakash
Disadvantages of PhoneGAP ..!
• Conditions Apply .
• Can be inefficient when working for native apps .
• Does not support all the functionality.
Dss Prakash
Dss Prakash
• https://build.phonegap.com/
• https://platform.telerik.com/
• https://appery.io/
Thank You
Dss Prakash

More Related Content

What's hot

Building Mobile Applications with Ionic
Building Mobile Applications with IonicBuilding Mobile Applications with Ionic
Building Mobile Applications with IonicMorris Singer
 
Progressive Web Apps: o melhor da Web appficada
Progressive Web Apps: o melhor da Web appficadaProgressive Web Apps: o melhor da Web appficada
Progressive Web Apps: o melhor da Web appficadaCaelum
 
The Art of AngularJS in 2015
The Art of AngularJS in 2015The Art of AngularJS in 2015
The Art of AngularJS in 2015Matt Raible
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsJames Pearce
 
Single page applications
Single page applicationsSingle page applications
Single page applicationsDiego Cardozo
 
High Performance Web Design
High Performance Web DesignHigh Performance Web Design
High Performance Web DesignKoji Ishimoto
 
State of jQuery June 2013 - Portland
State of jQuery June 2013 - PortlandState of jQuery June 2013 - Portland
State of jQuery June 2013 - Portlanddmethvin
 
Angular vs React for Web Application Development
Angular vs React for Web Application DevelopmentAngular vs React for Web Application Development
Angular vs React for Web Application DevelopmentFITC
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMconnectwebex
 
CIRCUIT 2015 - Content API's For AEM Sites
CIRCUIT 2015 - Content API's For AEM SitesCIRCUIT 2015 - Content API's For AEM Sites
CIRCUIT 2015 - Content API's For AEM SitesICF CIRCUIT
 
Anatomy of a Progressive Web App
Anatomy of a Progressive Web AppAnatomy of a Progressive Web App
Anatomy of a Progressive Web AppMike North
 
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulThe web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulRobert Nyman
 
Visual Automation Framework via Screenshot Comparison
Visual Automation Framework via Screenshot ComparisonVisual Automation Framework via Screenshot Comparison
Visual Automation Framework via Screenshot ComparisonMek Srunyu Stittri
 
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...Robert Nyman
 
I/O Rewind 215: What's new in Android
I/O Rewind 215: What's new in AndroidI/O Rewind 215: What's new in Android
I/O Rewind 215: What's new in AndroidSittiphol Phanvilai
 
Lesson learned from 3 years with hybrid apps
Lesson learned from 3 years with hybrid appsLesson learned from 3 years with hybrid apps
Lesson learned from 3 years with hybrid appsPatrik Malmquist
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016Matt Raible
 
Android JetPack: easy navigation with the new Navigation Controller
Android JetPack: easy navigation with the new Navigation ControllerAndroid JetPack: easy navigation with the new Navigation Controller
Android JetPack: easy navigation with the new Navigation ControllerLeonardo Pirro
 

What's hot (20)

Building Mobile Applications with Ionic
Building Mobile Applications with IonicBuilding Mobile Applications with Ionic
Building Mobile Applications with Ionic
 
Progressive Web Apps: o melhor da Web appficada
Progressive Web Apps: o melhor da Web appficadaProgressive Web Apps: o melhor da Web appficada
Progressive Web Apps: o melhor da Web appficada
 
The Art of AngularJS in 2015
The Art of AngularJS in 2015The Art of AngularJS in 2015
The Art of AngularJS in 2015
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applications
 
Single page applications
Single page applicationsSingle page applications
Single page applications
 
High Performance Web Design
High Performance Web DesignHigh Performance Web Design
High Performance Web Design
 
State of jQuery June 2013 - Portland
State of jQuery June 2013 - PortlandState of jQuery June 2013 - Portland
State of jQuery June 2013 - Portland
 
Angular vs React for Web Application Development
Angular vs React for Web Application DevelopmentAngular vs React for Web Application Development
Angular vs React for Web Application Development
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEM
 
CIRCUIT 2015 - Content API's For AEM Sites
CIRCUIT 2015 - Content API's For AEM SitesCIRCUIT 2015 - Content API's For AEM Sites
CIRCUIT 2015 - Content API's For AEM Sites
 
Anatomy of a Progressive Web App
Anatomy of a Progressive Web AppAnatomy of a Progressive Web App
Anatomy of a Progressive Web App
 
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulThe web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - Istanbul
 
Angularjs tutorial
Angularjs tutorialAngularjs tutorial
Angularjs tutorial
 
Visual Automation Framework via Screenshot Comparison
Visual Automation Framework via Screenshot ComparisonVisual Automation Framework via Screenshot Comparison
Visual Automation Framework via Screenshot Comparison
 
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
 
I/O Rewind 215: What's new in Android
I/O Rewind 215: What's new in AndroidI/O Rewind 215: What's new in Android
I/O Rewind 215: What's new in Android
 
Lesson learned from 3 years with hybrid apps
Lesson learned from 3 years with hybrid appsLesson learned from 3 years with hybrid apps
Lesson learned from 3 years with hybrid apps
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
 
Android JetPack: easy navigation with the new Navigation Controller
Android JetPack: easy navigation with the new Navigation ControllerAndroid JetPack: easy navigation with the new Navigation Controller
Android JetPack: easy navigation with the new Navigation Controller
 
Webworks
WebworksWebworks
Webworks
 

Viewers also liked

Pictavo Yearbook Software Guide
Pictavo Yearbook Software GuidePictavo Yearbook Software Guide
Pictavo Yearbook Software GuideYearbookLife
 
лицей29сент2011педсовет
лицей29сент2011педсоветлицей29сент2011педсовет
лицей29сент2011педсоветardabiev
 
Southern Arc Minerals Corporate Presentation
Southern Arc Minerals Corporate PresentationSouthern Arc Minerals Corporate Presentation
Southern Arc Minerals Corporate PresentationSouthernArc
 
Werkloze jongeren hebben litteken voor het leven
Werkloze jongeren hebben litteken voor het levenWerkloze jongeren hebben litteken voor het leven
Werkloze jongeren hebben litteken voor het levenid Plein BV
 
Yearbook Recognition and Dedication Ads
Yearbook Recognition and Dedication AdsYearbook Recognition and Dedication Ads
Yearbook Recognition and Dedication AdsYearbookLife
 
School Yearbook Theme
School Yearbook ThemeSchool Yearbook Theme
School Yearbook ThemeYearbookLife
 
High School Yearbook Cover options
High School Yearbook Cover optionsHigh School Yearbook Cover options
High School Yearbook Cover optionsYearbookLife
 
Vision,Mission,Strategy and Leadership.
Vision,Mission,Strategy and Leadership.Vision,Mission,Strategy and Leadership.
Vision,Mission,Strategy and Leadership.Sonia Verma
 
School Yearbook Staff Monthly Calendar
School Yearbook Staff Monthly CalendarSchool Yearbook Staff Monthly Calendar
School Yearbook Staff Monthly CalendarYearbookLife
 
02 01 아이디어_발상법-김용경[최종]
02 01 아이디어_발상법-김용경[최종]02 01 아이디어_발상법-김용경[최종]
02 01 아이디어_발상법-김용경[최종]Seonghee Jeon
 
Women entrepreneurship in india by sonia verma
Women entrepreneurship in india by sonia vermaWomen entrepreneurship in india by sonia verma
Women entrepreneurship in india by sonia vermaSonia Verma
 
Sensation and Perception
Sensation and PerceptionSensation and Perception
Sensation and PerceptionSophia Vadlit
 

Viewers also liked (17)

Pictavo Yearbook Software Guide
Pictavo Yearbook Software GuidePictavo Yearbook Software Guide
Pictavo Yearbook Software Guide
 
лицей29сент2011педсовет
лицей29сент2011педсоветлицей29сент2011педсовет
лицей29сент2011педсовет
 
Nodejs
NodejsNodejs
Nodejs
 
Southern Arc Minerals Corporate Presentation
Southern Arc Minerals Corporate PresentationSouthern Arc Minerals Corporate Presentation
Southern Arc Minerals Corporate Presentation
 
A-Evropa
A-EvropaA-Evropa
A-Evropa
 
Werkloze jongeren hebben litteken voor het leven
Werkloze jongeren hebben litteken voor het levenWerkloze jongeren hebben litteken voor het leven
Werkloze jongeren hebben litteken voor het leven
 
Yearbook Recognition and Dedication Ads
Yearbook Recognition and Dedication AdsYearbook Recognition and Dedication Ads
Yearbook Recognition and Dedication Ads
 
School Yearbook Theme
School Yearbook ThemeSchool Yearbook Theme
School Yearbook Theme
 
Yearbook Sales
Yearbook SalesYearbook Sales
Yearbook Sales
 
High School Yearbook Cover options
High School Yearbook Cover optionsHigh School Yearbook Cover options
High School Yearbook Cover options
 
Yearbook Coverage
Yearbook CoverageYearbook Coverage
Yearbook Coverage
 
Vision,Mission,Strategy and Leadership.
Vision,Mission,Strategy and Leadership.Vision,Mission,Strategy and Leadership.
Vision,Mission,Strategy and Leadership.
 
School Yearbook Staff Monthly Calendar
School Yearbook Staff Monthly CalendarSchool Yearbook Staff Monthly Calendar
School Yearbook Staff Monthly Calendar
 
02 01 아이디어_발상법-김용경[최종]
02 01 아이디어_발상법-김용경[최종]02 01 아이디어_발상법-김용경[최종]
02 01 아이디어_발상법-김용경[최종]
 
Baking
BakingBaking
Baking
 
Women entrepreneurship in india by sonia verma
Women entrepreneurship in india by sonia vermaWomen entrepreneurship in india by sonia verma
Women entrepreneurship in india by sonia verma
 
Sensation and Perception
Sensation and PerceptionSensation and Perception
Sensation and Perception
 

Similar to phonegap with angular js for freshers

Introduction phonegap
Introduction phonegapIntroduction phonegap
Introduction phonegapRakesh Jha
 
Advanced programing in phonegap
Advanced programing in phonegapAdvanced programing in phonegap
Advanced programing in phonegapRakesh Jha
 
Intro to PhoneGap and PhoneGap Build
Intro to PhoneGap and PhoneGap BuildIntro to PhoneGap and PhoneGap Build
Intro to PhoneGap and PhoneGap BuildChris Griffith
 
Mobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery MobileMobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery MobileTerry Ryan
 
Phonegap android
Phonegap androidPhonegap android
Phonegap androidumesh patil
 
移动端Web app开发
移动端Web app开发移动端Web app开发
移动端Web app开发Zhang Xiaoxue
 
3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.agup2009
 
From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)Bramus Van Damme
 
"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGap"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGapChristian Rokitta
 
Building native mobile apps using web technologies
Building native mobile apps using web technologiesBuilding native mobile apps using web technologies
Building native mobile apps using web technologiesHjörtur Hilmarsson
 
Android App Development using HTML5 Technology
Android App Development using HTML5 TechnologyAndroid App Development using HTML5 Technology
Android App Development using HTML5 TechnologyOon Arfiandwi
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App DevelopmentAnnmarie Lanesey
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache CordovaHazem Saleh
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkTroy Miles
 
Building Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsBuilding Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsTroy Miles
 
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014Hazem Saleh
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_uDoris Chen
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In ActionHazem Saleh
 
Mobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMartinSotirov
 

Similar to phonegap with angular js for freshers (20)

Introduction phonegap
Introduction phonegapIntroduction phonegap
Introduction phonegap
 
Advanced programing in phonegap
Advanced programing in phonegapAdvanced programing in phonegap
Advanced programing in phonegap
 
Intro to PhoneGap and PhoneGap Build
Intro to PhoneGap and PhoneGap BuildIntro to PhoneGap and PhoneGap Build
Intro to PhoneGap and PhoneGap Build
 
Mobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery MobileMobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery Mobile
 
Phonegap android
Phonegap androidPhonegap android
Phonegap android
 
移动端Web app开发
移动端Web app开发移动端Web app开发
移动端Web app开发
 
3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.
 
From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
 
"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGap"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGap
 
Building native mobile apps using web technologies
Building native mobile apps using web technologiesBuilding native mobile apps using web technologies
Building native mobile apps using web technologies
 
Android App Development using HTML5 Technology
Android App Development using HTML5 TechnologyAndroid App Development using HTML5 Technology
Android App Development using HTML5 Technology
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App Development
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
 
Building Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsBuilding Cross-Platform Mobile Apps
Building Cross-Platform Mobile Apps
 
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In Action
 
Mobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to Native
 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Recently uploaded (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

phonegap with angular js for freshers

  • 1. Mobile App Development using Dss Prakash
  • 2. Agenda • Why cross platform for mobile development . • What is PhoneGAP ? • How does phonegap work..? • PhoneGap features. • Setting-up Your PhoneGap Environment. • Creating “Hello World!” using PhoneGap. • PhoneGap Plugin development Dss Prakash
  • 3. Cross-Platform Mobile Apps • Design & Build the mobile app using HTML5,CSS3 & JavaScript • Bind up with Adobe PhoneGap -> Free Cordova open source framework or PhoneGap build. -> Get access to native API’s (Accelerometer, Camera, Compass, Device, Events, File, Geolocation, Media, etc. ) • Deploy to multiple platforms -> iOS ,Android ,Windows Phone ,Blackberry ,Symbian etc. ) • Multiple Cordova variants availble -> Telrik App Builder, IBM work light ,HP Anywhare etc. Dss Prakash
  • 4. 1. PhoneGap is still a product of Adobe. It is a distribution of Apache Cordova. Think of Apache Cordova as the engine that powers PhoneGap. Dss Prakash
  • 5. Apache Cordova • Apache Cordova is a platform for building natively installed mobile applications using HTML, CSS and JavaScript Dss Prakash
  • 6. What is PhoneGap? • Build mobile apps using HTML5, Javascript & CSS3 • PhoneGap was originally developed by Nitobi • In 2011, Adobe acquired Nitobi • PhoneGap was donated to the Apache Software Foundation (ASF) under the name Apache Cordova • Through the ASF, PhoneGap remains free and open source under the Apache License, Version 2.0 • PhoneGap adds extra features to Cordova (e.g. cloud build) • http://cordova.apache.org/ • http://phonegap.com/ Dss Prakash
  • 7. Installing PhoneGap C:> npm install -g phonegap $ phonegap create my-app $ cd my-app $ phonegap run android To Install, ensure that you have NodeJS installed, then open your command-line and run the following: Install Usage
  • 9. How does PhoneGap Work? • Include web code in a native app project: - assets/www/js/, css/, images/, etc. • Native code loads a URL to the web code through the device’s internal browser: - Extend a CordovaWebViewClient - super.loadUrl( “file:///android_asset/www/login.html” ); • Apache Cordova exposes native device APIs through JavaScript: - navigator.device.capture.captureImage( captureSuccess(), captureError(), [options] ); Dss Prakash
  • 11. 1. HTML5 and CCS 3 support. 2. Debugging and profiling . 3. Performance and memory usage. 4. Screen size and orientation . 5. DPI’s .(Dots per inch (dpi) is a measure of a display's pixel density). 6. User interface – or use just native look. 7. Performance and optimization Challenges in PhoneGap ..?
  • 12. 1. PhoneGap is not UI framework . 2. PhoneGap doesn't include a browser and /or rendering engine. 3. PhoneGap doesn't compile . 4. Every platform needs its own compilation. 5. HTML5/CSS3 compatibility. What is NOT PhoneGap ..?
  • 13. Creating “Hello World” ! • Creating the Android Project and create a activity extending to DroidGap • Add ‘phonegap.jar’ to libs folder <project>/libs • Add ‘phonegap.jar’ to java build path • Add the config.xml file located inside xml folder required for phone gap. Paste the entire xml folder inside res folder • Add the required permissions to AndroidMainfeast.xml folder • Creating the HTML (index.html) file and put in assets/www folder • Create and start AVD. Run the Application . Dss Prakash
  • 15. Html Code ..! Dss Prakash <!DOCTYPE html> <html> <head> <title>Device Properties Example</title> <script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script> <script type="text/javascript" charset="utf-8"> // Wait for Cordova to load document.addEventListener("deviceready", onDeviceReady, false); // Cordova is ready function onDeviceReady() { navigator.geolocation.getCurrentPosition(onSuccess, onError); } // onSuccess Geolocation function onSuccess(position) { var element = document.getElementById('geolocation'); element.innerHTML = 'Latitude: ' + position.coords.latitude + '<br />' + 'Longitude: ' + position.coords.longitude + '<br />' + 'Altitude: ' + position.coords.altitude + '<br />' + 'Accuracy: ' + position.coords.accuracy + '<br />' + 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '<br />' + } // onError Callback receives a PositionError object function onError(error) { alert('code: ' + error.code + 'n' + message: ' + error.message + 'n'); } </script> </head> <body> <p id="geolocation">Finding geolocation...</p> </body> </html>
  • 16. <!DOCTYPE html> <html ng-app="myApps"> <head> <link rel="stylesheet" type="text/css" href="css/style.css" /> <title>PhoneGap Plugins Example</title> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script> <script type="text/javascript" src="cordova.js"></script> <script src="js/myApp.js"></script> <script src="js/controller.js"></script> </head> <body><div ng-controller="controller"> <div> <h1>PhoneGap Plugins Example</h1> </div> <p><button class="myButton" ng-click="alertDeviceInfo()">Device</button></p> <p><button class="myButton" ng-click="alertGeoLocation()">Location</button></p> <p><button class="myButton" ng-click="beepNotify()">Beep</button></p> <p><button class="myButton" ng-click="vibrateNotify()">Vibrate</button></p> </div> <div> <a class="myButton" href="Gmap.html">Map</a> </div> <script type="text/javascript"> app.initialize(); </script> </body> </html> Index.html
  • 17. myApp.controller("controller", function($scope){ // Fetch Device info from Device Plugin $scope.alertDeviceInfo = function() { var deviceInfo = ('Device Platform: ' + device.platform + 'n' + 'Device Version: ' + device.version + 'n' + 'Device Model: ' + device.model + 'n' + 'Device UUID: ' + device.uuid + 'n'); navigator.notification.alert(deviceInfo); }; // Fetch location info from GeoLocation Plugin $scope.alertGeoLocation = function() { var onSuccess = function(position) { navigator.notification.alert('Latitude: ' + position.coords.latitude + 'n' + 'Longitude: ' + position.coords.longitude + 'n' + 'Altitude: ' + position.coords.altitude + 'n' + 'Accuracy: ' + position.coords.accuracy + 'n' + 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + 'n' + 'Heading: ' + position.coords.heading + 'n' + 'Timestamp: ' + position.timestamp + 'n'); }; navigator.geolocation.getCurrentPosition(onSuccess); }; // Makes a beep sound $scope.beepNotify = function() { navigator.notification.beep(1); }; // Vibrates the phone $scope.vibrateNotify = function() { navigator.notification.vibrate(1000); }; }); Controller.js
  • 18. var app = { // Application Constructor initialize: function() { this.bindEvents(); }, // Bind Event Listeners // Bind any events that are required on startup. Common events are: // 'load', 'deviceready', 'offline', and 'online'. bindEvents: function() { document.addEventListener('deviceready', this.onDeviceReady, false); }, // deviceready Event Handler // The scope of 'this' is the event. In order to call the 'receivedEvent' // function, we must explicity call 'app.receivedEvent(...);' onDeviceReady: function() { app.receivedEvent('deviceready'); }, // Update DOM on a Received Event receivedEvent: function(id) { console.log('Received Event: ' + id); } }; var myApp = angular.module('myApps', []); Index.js myApp.js
  • 19. PhoneGAP Advantages..! • Not required any programming language • Supportive for all major platforms • Support for Various API’s Dss Prakash
  • 20. Disadvantages of PhoneGAP ..! • Conditions Apply . • Can be inefficient when working for native apps . • Does not support all the functionality. Dss Prakash