SlideShare a Scribd company logo
Phonegap / Apache Cordova plugins
Connecting with native APIs
Overview of Apache
Cordova /Phonegap
Webkit Container-Based Applications on
Mobile Devices - Apache Cordova
When a browser-based application is executed on a mobile device, the JavaScript normally has no access to
hardware features of the mobile device such as the accelerometer, GPS location or the camera etc.
In order for a web-based application to gain access to these hardware features, it is necessary to run the
application within a container that acts both as a browser and provides an API to access the hardware.
Apache Cordova (also known as PhoneGap) provides this container.
Apache Cordova High Level Architecture
Mobile Device
Native Application
Web View
JavaScript, CSS, HTML, etc.
Plugin JavaScript
API
Native API
Plugin JavaScript
API
Native API
Plugin JavaScript
API
Native API
Plugin JavaScript
API
Native API
Apache Cordova’s standard PlugIns
•
Events
• pause, resume, online, offline, backbutton, menubutton, …
• Notification
• alert, confirm, prompt, beep, vibrate
• Capture
(Capture media files using device's media capture applications)
• Storage (DB device storage interface)
• Geolocation
• File
• Media (audio recording an playback)
• Contacts
Apache Cordova’s User Interface
Click icon to add picture
Phonegap / Apache Cordova Benefits
Large Community of Contributors
Developer community that needs little ramp-up
Supports most devices
Better performance at app startup and page loading
Config.xml approach to configure web app and turn on/off plugins
Network whitelisting approach to handle most web security threats
No silly configuration of UI using XML in Android
 Specific plugins for Apache Cordova
 Provides enterprise capabilities to a Cordova application
 Fits cleanly within existing Cordova development environments and processes
 Supports Android (4.0+), iOS (6.0+) and Windows 8.1 / Windows Phone 8.1
 A single application can be provisioned into the Webkit Webview container
 Enterprise app development can use Telerik verified plugins, if required
Phonegap / Apache Cordova plugins
© 2013 SAP AG. All rights reserved.
Apache Cordova Command Line
Client CLI
Apache Cordova
Before You Start
• To get started with Cordova you need a number of things in place and
configured.
• Node.JS– contains package manager used to install/update Cordova.
• http://nodejs.org/
• GIT – used to access source repositories where Cordova plugin’s and resources reside.
• Windows – install GIT from here: http://msysgit.github.io/
• OS X – install Xcode command line tools
• Gradle – used to build downloaded plugins
• Must install using Android Studio on Windows; Comes with Xcode command line tools;
http://ant.apache.org/manual/install.html
Apache Cordova
Command Line Interface (CLI) – Add Supported Device Platform
Command
• Supports iOS, Android and Windows 8.1 platform. Adding platforms to
your projects is simple with the Cordova CLI.
• Add Platform Command: cordova platform add <android/ios>
• Must be in Project’s root directory
• Need OS X to work with iOS platform; Windows OS to work with Windows 8.1
• Device specific resources copied (and downloaded if needed) into platforms/<device> directory.
• Note: Android SDK tools folder must be defined on the PATH environment variable
Apache Cordova
Command Line Interface (CLI) – Prepare Platform
• Once your platform independent resources are developed and placed in
the project’s www folder you can prepare the platforms so they are ready
for deployment.
• Add Prepare Platform Command:
cordova prepare <android/ios>
• Moves content found in main www folder to platform’s www folder.
Apache Cordova
Run Application on iOS Simulator
• For iOS, you can just open the project in Xcode by double clicking on the
.xcodeproj file.
• Then from Xcode just run it in the Simulator.
Apache Cordova
Run Application on Android Emulator
• Run on Emulator: cordova emulate android
• Run on Device: cordova run android
AppUpdate Plugin
• Lifecycle Management plugin
• Manages remote updating web
content within the Webkit
container
• www folder contents uploaded to
server.
• No special coding required.
• App checks if new update is
available – pulls new content from
server
Apache Cordova Push Plugin
• Manages the process of registering for push
requests plus
• Exposes events which help a developer code an
application to respond to push notifications
• User must be registered with server before
registering for push
• Must define push settings for application
• For list of Apache Cordova plugins:_
• https://www.webprogr.com/phonegap-plugins/
Push Plugin
Add Plugin to Project
• Cordova CLI has a command for adding plugins to your project.
• It must be executed in the root directory of a Cordova project.
• To add the Pushplugin:
cordova plugin add cordova-plugin-pushplugin
• Plugins are copied into the projects plugin directory, along with dependent plugins.
Push Plugin
Registering API
• To receive a notification user must register with APNS/GCM and register
their push notification token with server.
• <static> registerForNotificationTypes(types,
successCallback, errorCallback,
notificationlistenerfunc, senderId)
• types – Optional; Types of notifications the application wants to receive. The different types of
notifications are expressed in notificationType.
• successCallback – Optional function; called on successful registration
• errorCallback – Optional function; called on registration failure.
• notificationlistenerfunc – Optional function; called when the application is open and a
notification arrives.
• senderId – optional String; only used for GCM – the GCM Sender ID
Apache Cordova Encrypted Storage
Plugin
• Adds encrypted local storage to a
Cordova application (key-value pair)
• Store/Cache application data.
• Follows W3C Web Storage API with
some exceptions
• Works Asynchronously (like most things
on a mobile device).
Encrypted Storage Plugin
Add Plugin to Project
• Cordova CLI has a command for adding plugins to your project.
• It must be executed in the root directory of a Cordova project.
• To add the AppUpdate plugin:
cordova plugin add cordova-plugin-secure-storage
• Plugins are copied into the projects plugin directory, along with dependent plugins.
Apache Cordova app UX
• Supports any 3rd
Party HTML5
libraries. Sencha, Ionic, Framework
7, Ratchet.
• Ionic bundle based on Model View
Controller (MVC) architecture with
Google's Angular.js.
Model View Controller (MVC)
View
Controller
Model
For your next mobile app development project for multiplatforms
Contact us at www.webprogr.com/contactus.html
For more on Apache Cordova Phonegap mobile app development here
https://www.webprogr.com/phonegap-experts.html
Phone: +1 703 495 5847 Email: mktg@webprogr.com

More Related Content

What's hot (19)

PDF
Coders Workshop: API First Mobile Development Featuring Angular and Node
Apigee | Google Cloud
 
PPTX
SAPUI5/OpenUI5 - Continuous Integration
Peter Muessig
 
PDF
MuleSoft London Community November 2019 - MuleSoft and CICD
Pace Integration
 
PDF
Reusable Build Scripts for Managed Package Development (October 14, 2014)
Salesforce Partners
 
PPTX
Setting Up Development Environment For Google App Engine & Python | Talentica
Talentica Software
 
PDF
Serverless Media Workflow
MooYeol Lee
 
PDF
Web APIs, the New Language Frontier
Restlet
 
PPTX
Design-first API Development using Swagger and Node
Apigee | Google Cloud
 
DOCX
Sai krishna
Saikrishna1547
 
PPTX
開放原始碼 Ch1.2 intro - oss - apahce foundry (ver 2.0)
My own sweet home!
 
PDF
Postman: An Introduction for API Ops Professionals
Postman
 
PPT
Part 3 JasForge the collaborative and agile project v1.0
Jasmine Conseil
 
PDF
A quick introduction to Strapi CMS
Ashokkumar T A
 
PDF
Tech talk live on new alfresco api
Alfresco Software
 
PPTX
apidays LIVE Paris 2021 - Inside API delivery Pipeline, the checklist! - Fran...
apidays
 
PPTX
Continuous Integration Fundamentals: Maven - OFM Canberra July 2014
Joelith
 
PPTX
Oracle Cloud native functions - create application from cli
Johan Louwers
 
PPTX
MuleSoft Meetup slides_kualalumpur_19thSept_Undisturbed REST: Achieving Undis...
Manish Kumar Yadav
 
PPTX
Install Redis on Oracle Linux
Johan Louwers
 
Coders Workshop: API First Mobile Development Featuring Angular and Node
Apigee | Google Cloud
 
SAPUI5/OpenUI5 - Continuous Integration
Peter Muessig
 
MuleSoft London Community November 2019 - MuleSoft and CICD
Pace Integration
 
Reusable Build Scripts for Managed Package Development (October 14, 2014)
Salesforce Partners
 
Setting Up Development Environment For Google App Engine & Python | Talentica
Talentica Software
 
Serverless Media Workflow
MooYeol Lee
 
Web APIs, the New Language Frontier
Restlet
 
Design-first API Development using Swagger and Node
Apigee | Google Cloud
 
Sai krishna
Saikrishna1547
 
開放原始碼 Ch1.2 intro - oss - apahce foundry (ver 2.0)
My own sweet home!
 
Postman: An Introduction for API Ops Professionals
Postman
 
Part 3 JasForge the collaborative and agile project v1.0
Jasmine Conseil
 
A quick introduction to Strapi CMS
Ashokkumar T A
 
Tech talk live on new alfresco api
Alfresco Software
 
apidays LIVE Paris 2021 - Inside API delivery Pipeline, the checklist! - Fran...
apidays
 
Continuous Integration Fundamentals: Maven - OFM Canberra July 2014
Joelith
 
Oracle Cloud native functions - create application from cli
Johan Louwers
 
MuleSoft Meetup slides_kualalumpur_19thSept_Undisturbed REST: Achieving Undis...
Manish Kumar Yadav
 
Install Redis on Oracle Linux
Johan Louwers
 

Viewers also liked (17)

DOC
Laboratorio (placas paralelas)
Fidel Duran
 
PDF
9 crm and profitability -91-102
Alexander Decker
 
PDF
Johanson Husman_Viisto, väistö, valaisu, vuorovaikutus
Finnish Institute of Occupational Health, Promotion of Work Ability and Health
 
PDF
Historia
Sergyo Vitro
 
DOCX
Hoja informatica reporte_lectura
Jhonny Tenesaca
 
DOC
Sineme salonu tasarimi
Bilişim Şirketi
 
PDF
Taller ms excel edumatica
Maria Garcia
 
PPTX
2010 KCSAE 101 Chapter Development
Trevor S. Mitchell, CAE
 
PPTX
Presentation_NEW.PPTX
jameschloejames
 
PDF
Nano-Optical Fiber Evanescent Field Sensors
Radhi Chyad
 
PPTX
Суспільно-політичний рух у Наддніпрянській Україні у другій половині XIX ст.
Anatolii Barannik
 
PPTX
Презентація Беденок Ніни Трохимівни. Тема Полімери. Каучуки. Гума
Anatolii Barannik
 
DOCX
Cv remco figee slideshare
remco-figee
 
DOC
Preguntes i respostes tema 5 prehistòria
volcabisaroques
 
PPTX
Magazine
Flenny Wong
 
PPTX
Miastenia gravis
Joxe Gmero
 
PPTX
Reconnect(); Sevilla - Universal Windows Platform
Javier Suárez Ruiz
 
Laboratorio (placas paralelas)
Fidel Duran
 
9 crm and profitability -91-102
Alexander Decker
 
Johanson Husman_Viisto, väistö, valaisu, vuorovaikutus
Finnish Institute of Occupational Health, Promotion of Work Ability and Health
 
Historia
Sergyo Vitro
 
Hoja informatica reporte_lectura
Jhonny Tenesaca
 
Sineme salonu tasarimi
Bilişim Şirketi
 
Taller ms excel edumatica
Maria Garcia
 
2010 KCSAE 101 Chapter Development
Trevor S. Mitchell, CAE
 
Presentation_NEW.PPTX
jameschloejames
 
Nano-Optical Fiber Evanescent Field Sensors
Radhi Chyad
 
Суспільно-політичний рух у Наддніпрянській Україні у другій половині XIX ст.
Anatolii Barannik
 
Презентація Беденок Ніни Трохимівни. Тема Полімери. Каучуки. Гума
Anatolii Barannik
 
Cv remco figee slideshare
remco-figee
 
Preguntes i respostes tema 5 prehistòria
volcabisaroques
 
Magazine
Flenny Wong
 
Miastenia gravis
Joxe Gmero
 
Reconnect(); Sevilla - Universal Windows Platform
Javier Suárez Ruiz
 
Ad

Similar to Apache Cordova phonegap plugins for mobile app development (20)

PDF
Apache Cordova 4.x
Ivano Malavolta
 
PDF
Apache Cordova
Ivano Malavolta
 
PDF
[2015/2016] Apache Cordova
Ivano Malavolta
 
PDF
Cordova: APIs and instruments
Ivano Malavolta
 
PDF
Cordova 101
Rob Dudley
 
PDF
Apache cordova
Carlo Bernaschina
 
PPTX
Introduction to Apache Cordova (Phonegap)
ejlp12
 
PDF
Building Cross-Platform Mobile Apps
Troy Miles
 
PDF
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Hazem Saleh
 
PPTX
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
Hazem Saleh
 
PDF
Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL
Ron Gershinsky
 
ODP
Apache Cordova, Hybrid Application Development
thedumbterminal
 
PPTX
Apache Cordova In Action
Hazem Saleh
 
PPTX
Hybrid Mobile Development with Apache Cordova and
Ryan Cuprak
 
PPTX
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Ryan Cuprak
 
PPTX
Hybrid Mobile Applications
Ruwan Ranganath
 
PPTX
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
Hazem Saleh
 
PDF
Cordova Tutorial
Jacky Chen
 
KEY
Phonegap/Cordova vs Native Application
Muhammad Hakim A
 
PPTX
Workshop on Hybrid App Development with Ionic Framework
Aayush Shrestha
 
Apache Cordova 4.x
Ivano Malavolta
 
Apache Cordova
Ivano Malavolta
 
[2015/2016] Apache Cordova
Ivano Malavolta
 
Cordova: APIs and instruments
Ivano Malavolta
 
Cordova 101
Rob Dudley
 
Apache cordova
Carlo Bernaschina
 
Introduction to Apache Cordova (Phonegap)
ejlp12
 
Building Cross-Platform Mobile Apps
Troy Miles
 
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Hazem Saleh
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
Hazem Saleh
 
Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL
Ron Gershinsky
 
Apache Cordova, Hybrid Application Development
thedumbterminal
 
Apache Cordova In Action
Hazem Saleh
 
Hybrid Mobile Development with Apache Cordova and
Ryan Cuprak
 
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Ryan Cuprak
 
Hybrid Mobile Applications
Ruwan Ranganath
 
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
Hazem Saleh
 
Cordova Tutorial
Jacky Chen
 
Phonegap/Cordova vs Native Application
Muhammad Hakim A
 
Workshop on Hybrid App Development with Ionic Framework
Aayush Shrestha
 
Ad

Recently uploaded (8)

PDF
Building Smart, Scalable Solutions with Android App Development
Brancosoft Private Limited
 
PDF
INTERLINGUAL SYNTACTIC PARSING: AN OPTIMIZED HEAD-DRIVEN PARSING FOR ENGLISH ...
kevig
 
PDF
Call For Papers - International Journal on Natural Language Computing (IJNLC)
kevig
 
PPT
lec2 wireless transmission exlaining.ppt
212231
 
PPTX
Mobile Apps Helping Business Grow in 2025
Infylo Techsolutions
 
PDF
💡 Digital Marketing Decoded: Mastering Online Growth Strategies for 2025 🚀
marketingaura24
 
PPT
lect 1 Introduction.ppt11112222333344455
212231
 
PPTX
The Intersection of Emoji and NFT. What can be the Consequences?
Refit Global
 
Building Smart, Scalable Solutions with Android App Development
Brancosoft Private Limited
 
INTERLINGUAL SYNTACTIC PARSING: AN OPTIMIZED HEAD-DRIVEN PARSING FOR ENGLISH ...
kevig
 
Call For Papers - International Journal on Natural Language Computing (IJNLC)
kevig
 
lec2 wireless transmission exlaining.ppt
212231
 
Mobile Apps Helping Business Grow in 2025
Infylo Techsolutions
 
💡 Digital Marketing Decoded: Mastering Online Growth Strategies for 2025 🚀
marketingaura24
 
lect 1 Introduction.ppt11112222333344455
212231
 
The Intersection of Emoji and NFT. What can be the Consequences?
Refit Global
 

Apache Cordova phonegap plugins for mobile app development

  • 1. Phonegap / Apache Cordova plugins Connecting with native APIs
  • 3. Webkit Container-Based Applications on Mobile Devices - Apache Cordova When a browser-based application is executed on a mobile device, the JavaScript normally has no access to hardware features of the mobile device such as the accelerometer, GPS location or the camera etc. In order for a web-based application to gain access to these hardware features, it is necessary to run the application within a container that acts both as a browser and provides an API to access the hardware. Apache Cordova (also known as PhoneGap) provides this container.
  • 4. Apache Cordova High Level Architecture Mobile Device Native Application Web View JavaScript, CSS, HTML, etc. Plugin JavaScript API Native API Plugin JavaScript API Native API Plugin JavaScript API Native API Plugin JavaScript API Native API
  • 5. Apache Cordova’s standard PlugIns • Events • pause, resume, online, offline, backbutton, menubutton, … • Notification • alert, confirm, prompt, beep, vibrate • Capture (Capture media files using device's media capture applications) • Storage (DB device storage interface) • Geolocation • File • Media (audio recording an playback) • Contacts
  • 7. Click icon to add picture Phonegap / Apache Cordova Benefits Large Community of Contributors Developer community that needs little ramp-up Supports most devices Better performance at app startup and page loading Config.xml approach to configure web app and turn on/off plugins Network whitelisting approach to handle most web security threats No silly configuration of UI using XML in Android
  • 8.  Specific plugins for Apache Cordova  Provides enterprise capabilities to a Cordova application  Fits cleanly within existing Cordova development environments and processes  Supports Android (4.0+), iOS (6.0+) and Windows 8.1 / Windows Phone 8.1  A single application can be provisioned into the Webkit Webview container  Enterprise app development can use Telerik verified plugins, if required Phonegap / Apache Cordova plugins
  • 9. © 2013 SAP AG. All rights reserved. Apache Cordova Command Line Client CLI
  • 10. Apache Cordova Before You Start • To get started with Cordova you need a number of things in place and configured. • Node.JS– contains package manager used to install/update Cordova. • http://nodejs.org/ • GIT – used to access source repositories where Cordova plugin’s and resources reside. • Windows – install GIT from here: http://msysgit.github.io/ • OS X – install Xcode command line tools • Gradle – used to build downloaded plugins • Must install using Android Studio on Windows; Comes with Xcode command line tools; http://ant.apache.org/manual/install.html
  • 11. Apache Cordova Command Line Interface (CLI) – Add Supported Device Platform Command • Supports iOS, Android and Windows 8.1 platform. Adding platforms to your projects is simple with the Cordova CLI. • Add Platform Command: cordova platform add <android/ios> • Must be in Project’s root directory • Need OS X to work with iOS platform; Windows OS to work with Windows 8.1 • Device specific resources copied (and downloaded if needed) into platforms/<device> directory. • Note: Android SDK tools folder must be defined on the PATH environment variable
  • 12. Apache Cordova Command Line Interface (CLI) – Prepare Platform • Once your platform independent resources are developed and placed in the project’s www folder you can prepare the platforms so they are ready for deployment. • Add Prepare Platform Command: cordova prepare <android/ios> • Moves content found in main www folder to platform’s www folder.
  • 13. Apache Cordova Run Application on iOS Simulator • For iOS, you can just open the project in Xcode by double clicking on the .xcodeproj file. • Then from Xcode just run it in the Simulator.
  • 14. Apache Cordova Run Application on Android Emulator • Run on Emulator: cordova emulate android • Run on Device: cordova run android
  • 15. AppUpdate Plugin • Lifecycle Management plugin • Manages remote updating web content within the Webkit container • www folder contents uploaded to server. • No special coding required. • App checks if new update is available – pulls new content from server
  • 16. Apache Cordova Push Plugin • Manages the process of registering for push requests plus • Exposes events which help a developer code an application to respond to push notifications • User must be registered with server before registering for push • Must define push settings for application • For list of Apache Cordova plugins:_ • https://www.webprogr.com/phonegap-plugins/
  • 17. Push Plugin Add Plugin to Project • Cordova CLI has a command for adding plugins to your project. • It must be executed in the root directory of a Cordova project. • To add the Pushplugin: cordova plugin add cordova-plugin-pushplugin • Plugins are copied into the projects plugin directory, along with dependent plugins.
  • 18. Push Plugin Registering API • To receive a notification user must register with APNS/GCM and register their push notification token with server. • <static> registerForNotificationTypes(types, successCallback, errorCallback, notificationlistenerfunc, senderId) • types – Optional; Types of notifications the application wants to receive. The different types of notifications are expressed in notificationType. • successCallback – Optional function; called on successful registration • errorCallback – Optional function; called on registration failure. • notificationlistenerfunc – Optional function; called when the application is open and a notification arrives. • senderId – optional String; only used for GCM – the GCM Sender ID
  • 19. Apache Cordova Encrypted Storage Plugin • Adds encrypted local storage to a Cordova application (key-value pair) • Store/Cache application data. • Follows W3C Web Storage API with some exceptions • Works Asynchronously (like most things on a mobile device).
  • 20. Encrypted Storage Plugin Add Plugin to Project • Cordova CLI has a command for adding plugins to your project. • It must be executed in the root directory of a Cordova project. • To add the AppUpdate plugin: cordova plugin add cordova-plugin-secure-storage • Plugins are copied into the projects plugin directory, along with dependent plugins.
  • 21. Apache Cordova app UX • Supports any 3rd Party HTML5 libraries. Sencha, Ionic, Framework 7, Ratchet. • Ionic bundle based on Model View Controller (MVC) architecture with Google's Angular.js.
  • 22. Model View Controller (MVC) View Controller Model
  • 23. For your next mobile app development project for multiplatforms Contact us at www.webprogr.com/contactus.html For more on Apache Cordova Phonegap mobile app development here https://www.webprogr.com/phonegap-experts.html Phone: +1 703 495 5847 Email: [email protected]

Editor's Notes

  • #19: APNS = Apple Push Notification Service GCM = Google Cloud Messaging