SlideShare a Scribd company logo
CORDOVA TRAINING
SESSION: 7 - CORDOVA PLUGINS
INTRODUCTION
 A plugin provides JavaScript interface to native components.
 They allow your app to use native device capabilities beyond what is available to pure
web apps.
PLATFORM SUPPORT
 Cordova plugins support the following platforms mainly:
 Android
 iOS
 Windows Phone 8
 Windows Phone 8.1, 10
 Blackberry 10
COMMAND LINE INTERFACE
/
CLI
SEARCHING FOR A PLUGIN
 Cordova provides CLI / Command Line Interface for searching for a plugin.The syntax
is:
 cordova plugin search <keyword>
ADDING A PLUGIN
 Cordova provides CLI / Command Line Interface for adding a plugin.The syntax is:
 cordova plugin add <plugin-name>
VIEWING INSTALLED PLUGINS
 Cordova provides CLI / Command Line Interface for listing the installed plugin(s). The
syntax is:
 cordova plugin ls
 cordova plugin list
REMOVE INSTALLED PLUGINS
 Cordova provides CLI / Command Line Interface for removing the installed plugin(s).
The syntax is:
 cordova plugin remove <plugin_name>
 cordova plugin rm <plugin_name>
PLUGINS
DEVICE
 Cordova provides the following plugin to access the device details. The CLI command
is:
 cordova plugin add cordova-plugin-device
DEVICE
 Once the plugin is added, we will get the following attributes:
 device.cordova
 device.model
 device.platform
 device.uuid
 device.version
 device.manufacturer
 device.isVirtual
 device.serial
VIBRATION SERVICE
 Cordova provides the following plugin to access the vibration feature/service. The CLI
command is:
 cordova plugin add cordova-plugin-vibration
 Once the plugin is added, we can access the vibration service using the following API:
 navigator.vibrate(time);
NETWORK INFORMATION
 Cordova provides the following plugin to access the network feature/service. The CLI
command is:
 cordova plugin add cordova-plugin-network-information
 Once the plugin is added, we can access the network service using the following API:
 navigator.connection
NETWORK INFORMATION
 The network type can be detected using the following property:
 navigator.connection.type
 The type can be either of the following:
 Connection.UNKNOWN | Connection.ETHERNET | Connection.WIFI
 Connection.CELL_2G | Connection.CELL_3G | Connection.CELL_4G
 Connection.CELL | Connection.NONE
DIALOGS
 Cordova provides the following plugin to implement native device dialogs. The CLI
command is:
 cordova plugin add cordova-plugin-dialogs
 Once the plugin is added, we will get the following methods:
 navigator.notification.alert
 navigator.notification.confirm
 navigator.notification.prompt
 navigator.notification.beep
DIALOGS - SYNTAX
 navigator.notification.alert(message, alertCallback, [title], [buttonName])
 navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
 navigator.notification.prompt(message, promptCallback, [title], [buttonLabels],
[defaultText])
 navigator.notification.beep(times);
BATTERY STATUS
 Cordova provides the following plugin to access device battery information. The CLI
command is:
 cordova plugin add cordova-plugin-battery-status
 Once the plugin is added, we will get the following events:
 batterystatus
 batterylow
 batterycritical
BATTERY STATUS
 window.addEventListener("batterystatus", onBatteryStatus, false);
function onBatteryStatus(status) {
console.log("Level: " + status.level + " isPlugged: " + status.isPlugged);
}
BATTERY STATUS
 window.addEventListener("batterylow", onBatteryLow, false);
function onBatteryLow(status) {
alert("Battery Level Low " + status.level + "%");
}
BATTERY STATUS
 window.addEventListener("batterycritical", onBatteryCritical, false);
function onBatteryCritical(status) {
alert("Battery Level Critical " + status.level + "%nRecharge Soon!");
}
CAMERA
 Cordova provides the following plugin to access device battery information. The CLI
command is:
 cordova plugin add cordova-plugin-camera
 To capture an image, we can use the getPicture method. The syntax is:
 camera.getPicture(successCallback, errorCallback, options);
CAMERA
navigator.camera.getPicture(onSuccess, onFail, {quality:50, destinationType:
Camera.DestinationType.DATA_URL});
function onSuccess(imageData) {
var image = document.getElementById('myImage');
image.src = "data:image/jpeg;base64," + imageData;
}
function onFail(message) { alert('Failed because: ' + message);}
CAMERA
 Camera options:
 quality : 0 – 100
 destinationType : DATA_URL | FILE_URI
 encodingType : JPEG | PNG
 mediaType : PICTURE | VIDEO
 cameraDirection : FRONT | BACK
THANK YOU

More Related Content

What's hot

Android development 1july
Android development 1julyAndroid development 1july
Android development 1julyEdureka!
 
Learn How to Animate your Android App
Learn How to Animate your Android AppLearn How to Animate your Android App
Learn How to Animate your Android App
Edureka!
 
Presentation Emil Lingmerth - 23 Video
Presentation Emil Lingmerth - 23 VideoPresentation Emil Lingmerth - 23 Video
Presentation Emil Lingmerth - 23 Video
Emil Lingmerth
 
JavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaFX 8 everywhere; write once run anywhere by Mohamed TamanJavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaDayUA
 
Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland
Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, FinlandGetting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland
Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland
Artem Marchenko
 
Google closure compiler
Google closure compilerGoogle closure compiler
Google closure compiler
Prasad Kancharla
 
What is java fx?
What is java fx?What is java fx?
What is java fx?
kanchanmahajan23
 
Quickly Build a Native Mobile App for Your Community Using Salesforce Mobile SDK
Quickly Build a Native Mobile App for Your Community Using Salesforce Mobile SDKQuickly Build a Native Mobile App for Your Community Using Salesforce Mobile SDK
Quickly Build a Native Mobile App for Your Community Using Salesforce Mobile SDK
Salesforce Developers
 
Features of java unit 1
Features of java unit 1Features of java unit 1
Features of java unit 1
RubaNagarajan
 
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
UA Mobile
 
Developing for the BlackBerry PlayBook using Flex Builder Burrito
Developing for the BlackBerry PlayBook using Flex Builder BurritoDeveloping for the BlackBerry PlayBook using Flex Builder Burrito
Developing for the BlackBerry PlayBook using Flex Builder Burrito
Yuri Visser
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworks
Yuri Visser
 
The Technical Side of Harvard.edu Redesign
The Technical Side of Harvard.edu RedesignThe Technical Side of Harvard.edu Redesign
The Technical Side of Harvard.edu Redesign
Harvard Web Working Group
 
Software environment
Software environmentSoftware environment
Software environment
Kinnudj Amee
 
Adobe AIR. NativeProcess. FFMPEG. Awesome.
Adobe AIR. NativeProcess. FFMPEG. Awesome.Adobe AIR. NativeProcess. FFMPEG. Awesome.
Adobe AIR. NativeProcess. FFMPEG. Awesome.
Joseph Labrecque
 
EVOLVE'16 | Deploy | Abhishek Dwevedi | Introduction to AEM Front End Develop...
EVOLVE'16 | Deploy | Abhishek Dwevedi | Introduction to AEM Front End Develop...EVOLVE'16 | Deploy | Abhishek Dwevedi | Introduction to AEM Front End Develop...
EVOLVE'16 | Deploy | Abhishek Dwevedi | Introduction to AEM Front End Develop...
Evolve The Adobe Digital Marketing Community
 
eRCP Overview and Update '06
eRCP Overview  and Update '06eRCP Overview  and Update '06
eRCP Overview and Update '06
Gorkem Ercan
 

What's hot (19)

Android development 1july
Android development 1julyAndroid development 1july
Android development 1july
 
Readme
ReadmeReadme
Readme
 
Learn How to Animate your Android App
Learn How to Animate your Android AppLearn How to Animate your Android App
Learn How to Animate your Android App
 
Presentation Emil Lingmerth - 23 Video
Presentation Emil Lingmerth - 23 VideoPresentation Emil Lingmerth - 23 Video
Presentation Emil Lingmerth - 23 Video
 
JavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaFX 8 everywhere; write once run anywhere by Mohamed TamanJavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaFX 8 everywhere; write once run anywhere by Mohamed Taman
 
Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland
Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, FinlandGetting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland
Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland
 
Google closure compiler
Google closure compilerGoogle closure compiler
Google closure compiler
 
What is java fx?
What is java fx?What is java fx?
What is java fx?
 
Quickly Build a Native Mobile App for Your Community Using Salesforce Mobile SDK
Quickly Build a Native Mobile App for Your Community Using Salesforce Mobile SDKQuickly Build a Native Mobile App for Your Community Using Salesforce Mobile SDK
Quickly Build a Native Mobile App for Your Community Using Salesforce Mobile SDK
 
Features of java unit 1
Features of java unit 1Features of java unit 1
Features of java unit 1
 
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
 
Developing for the BlackBerry PlayBook using Flex Builder Burrito
Developing for the BlackBerry PlayBook using Flex Builder BurritoDeveloping for the BlackBerry PlayBook using Flex Builder Burrito
Developing for the BlackBerry PlayBook using Flex Builder Burrito
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworks
 
The Technical Side of Harvard.edu Redesign
The Technical Side of Harvard.edu RedesignThe Technical Side of Harvard.edu Redesign
The Technical Side of Harvard.edu Redesign
 
Apple TV - a quick start guide
Apple TV - a quick start guideApple TV - a quick start guide
Apple TV - a quick start guide
 
Software environment
Software environmentSoftware environment
Software environment
 
Adobe AIR. NativeProcess. FFMPEG. Awesome.
Adobe AIR. NativeProcess. FFMPEG. Awesome.Adobe AIR. NativeProcess. FFMPEG. Awesome.
Adobe AIR. NativeProcess. FFMPEG. Awesome.
 
EVOLVE'16 | Deploy | Abhishek Dwevedi | Introduction to AEM Front End Develop...
EVOLVE'16 | Deploy | Abhishek Dwevedi | Introduction to AEM Front End Develop...EVOLVE'16 | Deploy | Abhishek Dwevedi | Introduction to AEM Front End Develop...
EVOLVE'16 | Deploy | Abhishek Dwevedi | Introduction to AEM Front End Develop...
 
eRCP Overview and Update '06
eRCP Overview  and Update '06eRCP Overview  and Update '06
eRCP Overview and Update '06
 

Similar to Cordova training : Cordova plugins

[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
Hazem Saleh
 
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
Hazem Saleh
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In Action
Hazem Saleh
 
[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
Hazem Saleh
 
Manish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsManish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsPositive Hack Days
 
[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action
Hazem Saleh
 
Cordova 3, apps para android
Cordova 3, apps para androidCordova 3, apps para android
Cordova 3, apps para android
Droidcon Spain
 
Cordova iOS Native Plugin Development
Cordova iOS Native Plugin DevelopmentCordova iOS Native Plugin Development
Cordova iOS Native Plugin Development
Josue Bustos
 
Cordova Mobile Application Developer Certification
Cordova Mobile Application Developer CertificationCordova Mobile Application Developer Certification
Cordova Mobile Application Developer Certification
Vskills
 
[ApacheCon 2016] Advanced Apache Cordova
[ApacheCon 2016] Advanced Apache Cordova[ApacheCon 2016] Advanced Apache Cordova
[ApacheCon 2016] Advanced Apache Cordova
Hazem Saleh
 
Bring Continuous Integration to Your Laptop With the Drone CI Docker Extensio...
Bring Continuous Integration to Your Laptop With the Drone CI Docker Extensio...Bring Continuous Integration to Your Laptop With the Drone CI Docker Extensio...
Bring Continuous Integration to Your Laptop With the Drone CI Docker Extensio...
jemije2490
 
Android tools for testers
Android tools for testersAndroid tools for testers
Android tools for testers
Maksim Kovalev
 
Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019
Sargis Sargsyan
 
PhoneGap Day 2016 USA
PhoneGap Day 2016 USAPhoneGap Day 2016 USA
PhoneGap Day 2016 USA
Ryan J. Salva
 
App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲益祥 許
 
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e DroneTDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
tdc-globalcode
 
Cordova 3.x
Cordova 3.xCordova 3.x
Cordova 3.x
George McKinney
 
Cordova Tutorial
Cordova TutorialCordova Tutorial
Cordova Tutorial
Jacky Chen
 
Droidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introductionDroidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introduction
Michelantonio Trizio
 
Android wear SDK introduction
Android wear SDK introductionAndroid wear SDK introduction
Android wear SDK introduction
Tiziano Basile
 

Similar to Cordova training : Cordova plugins (20)

[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
 
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
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In Action
 
[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
 
Manish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsManish Chasta - Securing Android Applications
Manish Chasta - Securing Android Applications
 
[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action
 
Cordova 3, apps para android
Cordova 3, apps para androidCordova 3, apps para android
Cordova 3, apps para android
 
Cordova iOS Native Plugin Development
Cordova iOS Native Plugin DevelopmentCordova iOS Native Plugin Development
Cordova iOS Native Plugin Development
 
Cordova Mobile Application Developer Certification
Cordova Mobile Application Developer CertificationCordova Mobile Application Developer Certification
Cordova Mobile Application Developer Certification
 
[ApacheCon 2016] Advanced Apache Cordova
[ApacheCon 2016] Advanced Apache Cordova[ApacheCon 2016] Advanced Apache Cordova
[ApacheCon 2016] Advanced Apache Cordova
 
Bring Continuous Integration to Your Laptop With the Drone CI Docker Extensio...
Bring Continuous Integration to Your Laptop With the Drone CI Docker Extensio...Bring Continuous Integration to Your Laptop With the Drone CI Docker Extensio...
Bring Continuous Integration to Your Laptop With the Drone CI Docker Extensio...
 
Android tools for testers
Android tools for testersAndroid tools for testers
Android tools for testers
 
Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019
 
PhoneGap Day 2016 USA
PhoneGap Day 2016 USAPhoneGap Day 2016 USA
PhoneGap Day 2016 USA
 
App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲
 
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e DroneTDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
 
Cordova 3.x
Cordova 3.xCordova 3.x
Cordova 3.x
 
Cordova Tutorial
Cordova TutorialCordova Tutorial
Cordova Tutorial
 
Droidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introductionDroidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introduction
 
Android wear SDK introduction
Android wear SDK introductionAndroid wear SDK introduction
Android wear SDK introduction
 

More from Binu Paul

GIT
GITGIT
Cordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITECordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITE
Binu Paul
 
Cordova training - Day 8 - REST API's
Cordova training - Day 8 - REST API'sCordova training - Day 8 - REST API's
Cordova training - Day 8 - REST API's
Binu Paul
 
Cordova training - Day 7 - Form data processing
Cordova training - Day 7 - Form data processingCordova training - Day 7 - Form data processing
Cordova training - Day 7 - Form data processing
Binu Paul
 
Cordova training : Day 6 - UI development using Framework7
Cordova training : Day 6 - UI development using Framework7Cordova training : Day 6 - UI development using Framework7
Cordova training : Day 6 - UI development using Framework7
Binu Paul
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced JavascriptCordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced Javascript
Binu Paul
 
Cordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to JavascriptCordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to Javascript
Binu Paul
 
Cordova training - Day 3 : Advanced CSS 3
Cordova training - Day 3 : Advanced CSS 3Cordova training - Day 3 : Advanced CSS 3
Cordova training - Day 3 : Advanced CSS 3
Binu Paul
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3
Binu Paul
 

More from Binu Paul (9)

GIT
GITGIT
GIT
 
Cordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITECordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITE
 
Cordova training - Day 8 - REST API's
Cordova training - Day 8 - REST API'sCordova training - Day 8 - REST API's
Cordova training - Day 8 - REST API's
 
Cordova training - Day 7 - Form data processing
Cordova training - Day 7 - Form data processingCordova training - Day 7 - Form data processing
Cordova training - Day 7 - Form data processing
 
Cordova training : Day 6 - UI development using Framework7
Cordova training : Day 6 - UI development using Framework7Cordova training : Day 6 - UI development using Framework7
Cordova training : Day 6 - UI development using Framework7
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced JavascriptCordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced Javascript
 
Cordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to JavascriptCordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to Javascript
 
Cordova training - Day 3 : Advanced CSS 3
Cordova training - Day 3 : Advanced CSS 3Cordova training - Day 3 : Advanced CSS 3
Cordova training - Day 3 : Advanced CSS 3
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3
 

Recently uploaded

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 

Recently uploaded (20)

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 

Cordova training : Cordova plugins

  • 1. CORDOVA TRAINING SESSION: 7 - CORDOVA PLUGINS
  • 2. INTRODUCTION  A plugin provides JavaScript interface to native components.  They allow your app to use native device capabilities beyond what is available to pure web apps.
  • 3. PLATFORM SUPPORT  Cordova plugins support the following platforms mainly:  Android  iOS  Windows Phone 8  Windows Phone 8.1, 10  Blackberry 10
  • 5. SEARCHING FOR A PLUGIN  Cordova provides CLI / Command Line Interface for searching for a plugin.The syntax is:  cordova plugin search <keyword>
  • 6. ADDING A PLUGIN  Cordova provides CLI / Command Line Interface for adding a plugin.The syntax is:  cordova plugin add <plugin-name>
  • 7. VIEWING INSTALLED PLUGINS  Cordova provides CLI / Command Line Interface for listing the installed plugin(s). The syntax is:  cordova plugin ls  cordova plugin list
  • 8. REMOVE INSTALLED PLUGINS  Cordova provides CLI / Command Line Interface for removing the installed plugin(s). The syntax is:  cordova plugin remove <plugin_name>  cordova plugin rm <plugin_name>
  • 10. DEVICE  Cordova provides the following plugin to access the device details. The CLI command is:  cordova plugin add cordova-plugin-device
  • 11. DEVICE  Once the plugin is added, we will get the following attributes:  device.cordova  device.model  device.platform  device.uuid  device.version  device.manufacturer  device.isVirtual  device.serial
  • 12. VIBRATION SERVICE  Cordova provides the following plugin to access the vibration feature/service. The CLI command is:  cordova plugin add cordova-plugin-vibration  Once the plugin is added, we can access the vibration service using the following API:  navigator.vibrate(time);
  • 13. NETWORK INFORMATION  Cordova provides the following plugin to access the network feature/service. The CLI command is:  cordova plugin add cordova-plugin-network-information  Once the plugin is added, we can access the network service using the following API:  navigator.connection
  • 14. NETWORK INFORMATION  The network type can be detected using the following property:  navigator.connection.type  The type can be either of the following:  Connection.UNKNOWN | Connection.ETHERNET | Connection.WIFI  Connection.CELL_2G | Connection.CELL_3G | Connection.CELL_4G  Connection.CELL | Connection.NONE
  • 15. DIALOGS  Cordova provides the following plugin to implement native device dialogs. The CLI command is:  cordova plugin add cordova-plugin-dialogs  Once the plugin is added, we will get the following methods:  navigator.notification.alert  navigator.notification.confirm  navigator.notification.prompt  navigator.notification.beep
  • 16. DIALOGS - SYNTAX  navigator.notification.alert(message, alertCallback, [title], [buttonName])  navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])  navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])  navigator.notification.beep(times);
  • 17. BATTERY STATUS  Cordova provides the following plugin to access device battery information. The CLI command is:  cordova plugin add cordova-plugin-battery-status  Once the plugin is added, we will get the following events:  batterystatus  batterylow  batterycritical
  • 18. BATTERY STATUS  window.addEventListener("batterystatus", onBatteryStatus, false); function onBatteryStatus(status) { console.log("Level: " + status.level + " isPlugged: " + status.isPlugged); }
  • 19. BATTERY STATUS  window.addEventListener("batterylow", onBatteryLow, false); function onBatteryLow(status) { alert("Battery Level Low " + status.level + "%"); }
  • 20. BATTERY STATUS  window.addEventListener("batterycritical", onBatteryCritical, false); function onBatteryCritical(status) { alert("Battery Level Critical " + status.level + "%nRecharge Soon!"); }
  • 21. CAMERA  Cordova provides the following plugin to access device battery information. The CLI command is:  cordova plugin add cordova-plugin-camera  To capture an image, we can use the getPicture method. The syntax is:  camera.getPicture(successCallback, errorCallback, options);
  • 22. CAMERA navigator.camera.getPicture(onSuccess, onFail, {quality:50, destinationType: Camera.DestinationType.DATA_URL}); function onSuccess(imageData) { var image = document.getElementById('myImage'); image.src = "data:image/jpeg;base64," + imageData; } function onFail(message) { alert('Failed because: ' + message);}
  • 23. CAMERA  Camera options:  quality : 0 – 100  destinationType : DATA_URL | FILE_URI  encodingType : JPEG | PNG  mediaType : PICTURE | VIDEO  cameraDirection : FRONT | BACK