SlideShare une entreprise Scribd logo
1  sur  42
PhoneGap Hardware Manipulation Accessing the device native APIs ,[object Object],[object Object],[object Object],[object Object],[object Object]
Table of Contents ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object]
The Device Object ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Notification API ,[object Object],[object Object],[object Object],[object Object],navigator.notification = { alert(message, alertCallback, [title], [buttonName]),  confirm(message, confirmCallback, [title], [buttonLabels]),  vibrate(milliseconds), beep(times) }
Connection API ,[object Object],[object Object],[object Object],[object Object]
Connection API (2) ,[object Object],Connection.NONE  - No network connection detected  Connection.ETHERNET - LAN network connection  Connection.WIFI  - Wireless B/G/N connection type  Connection.CELL_2G  - 2G connection type- GPRS or EDGE (2.5G) Connection.CELL_3G  - 3G HSPA connection type  Connection.CELL_4G  - LTE or WiMax connection type  Connection.UNKNOWN  - the connection type cannot be determined
Connection API (3) function checkConnection() {     var networkState = navigator.network. connection.type ;     var states = {};     states[ Connection .UNKNOWN]  = 'Unknown connection';     states[ Connection .ETHERNET] = 'Ethernet connection';     states[ Connection .WIFI]     = 'WiFi connection';     states[ Connection .CELL_2G]  = 'Cell 2G connection';     states[ Connection .CELL_3G]  = 'Cell 3G connection';     states[ Connection .CELL_4G]  = 'Cell 4G connection';     states[ Connection .NONE]     = 'No network connection';     alert(' Connection  type: ' + states[networkState]); } checkConnection();
Events ,[object Object],[object Object],[object Object],[object Object]
The deviceready event ,[object Object],[object Object],document.addEventListener("deviceready",  onDeviceReady,    false); function onDeviceReady() { // Fill out the PhoneGap version  $("#phonegap_version").text(device.phonegap); }
The pause/resume events ,[object Object],[object Object],[object Object],[object Object]
The pause/resume events (2) document.addEventListener("pause", onPause, false); document.addEventListener("resume", onResume, false); function onPause() {  navigator.compass.clearWatch(compassId); } function onResume() {    compassId = navigator.compass .watchHeading( function (heading) { // do something }); }
The online/offline Events ,[object Object],[object Object],document.addEventListener("online", onOnline, false); document.addEventListener("offline", onOffline, false); function onOnline() {  // Handle the online event  } function onOffline() {  // Handle the offline event  }
The batterystatus / batterylow / batterycritical events ,[object Object],[object Object],[object Object]
The batterystatus / batterylow / batterycritical events (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Button Events ,[object Object],[object Object],backbutton (Android and BlackBerry) menubutton (Android and BlackBerry) searchbutton (Android) startcallbutton (BlackBerry) endcallbutton (BlackBerry) volumedownbutton (BlackBerry) volumeupbutton (BlackBerry)
Compass (1) ,[object Object],[object Object]
Compass (2) ,[object Object],navigator.compass = {  getCurrentHeading (compassSuccess, [compassError],    [compassOptions]), int  watchHeading (compassSuccess, [compassError],    [compassOptions]),  clearWatch (watchId),  int  watchHeadingFilter (compassSuccess, [compassError],    [compassOptions]), // Only on iOS.   clearWatchFilter (watchId) // Only on iOS. }
Compass (3) ,[object Object],CompassHeading = {  magneticHeading : The heading in degrees from 0-359.99, trueHeading : The heading relative to the geographic North in degrees 0-359.99. A negative value indicates that the true heading could not be determined. Some platforms return directly the magnetic heading instead, headingAccuracy : The deviation in degrees between the reported heading and the true heading, timestamp : The timestamp of the reading }
Compass (4) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Compass Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Accelerometer (1) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Accelerometer (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Accelerometer Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Geolocation (1) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Geolocation (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Geolocation (3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Geolocation (4) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Geolocation (5) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Geolocation Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Camera (1) ,[object Object],[object Object],[object Object],navigator.camera.getPicture(onSuccess,  onFail,  [Settings]);
Camera (2) ,[object Object],cameraOptions = {  quality : Quality of saved image - range [0, 100],  destinationType : DATA_URL or FILE_URI,  sourceType : CAMERA, PHOTOLIBRARY or SAVEDPHOTOALBUM, mediaType : PICTURE, VIDEO, ALLMEDIA, allowEdit : Allow simple editing of image before selection, encodingType : JPEG or PNG, targetWidth : Width in pixels to scale image, targetHeight : Height in pixels to scale image };
Camera Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Contacts (1) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],contact = navigator.contacts.create({"displayName": "Test User"});
Contacts (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Contacts (3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],{ save (onSuccess, [onError]) – saves the contact in the device, clone () – clones the contact and sets its ID to null, remove (onSuccess, [onError]) – removes a contact }
Contacts (5) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Contacts (6) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],ContactField = { type : The field type (example: ‘office'), value : The value of the field (such as a phone number or email address) }
Contacts (7) ,[object Object],[object Object],[object Object],[object Object],ContactFindOptions = { filter : Search string to filter contacts - default "", multiple : Should return multiple results – default false } ContactError.UNKNOWN_ERROR, ContactError.INVALID_ARGUMENT_ERROR, ContactError.TIMEOUT_ERROR, ContactError.PENDING_OPERATION_ERROR, ContactError.IO_ERROR, ContactError.NOT_SUPPORTED_ERROR, ContactError.PERMISSION_DENIED_ERROR
Contacts Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Homework ,[object Object],[object Object]

Contenu connexe

Similaire à PhoneGap - Hardware Manipulation

Error ontologies and altarica transformation aadl meeting florida jan 24-27
Error ontologies and altarica transformation   aadl meeting florida jan 24-27Error ontologies and altarica transformation   aadl meeting florida jan 24-27
Error ontologies and altarica transformation aadl meeting florida jan 24-27Vangelis Vassiliadis
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCJim Tochterman
 
W 0300 codingfor_life-batterylifethatis
W 0300 codingfor_life-batterylifethatisW 0300 codingfor_life-batterylifethatis
W 0300 codingfor_life-batterylifethatisjicheng687
 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Davide Cerbo
 
Non Conventional Android Programming En
Non Conventional Android Programming EnNon Conventional Android Programming En
Non Conventional Android Programming Enguest9bcef2f
 
Mobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptMobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptfranksvalli
 
Pandora FMS: Windows Phone 7 Agent
Pandora FMS: Windows Phone 7 AgentPandora FMS: Windows Phone 7 Agent
Pandora FMS: Windows Phone 7 AgentPandora FMS
 
Firefox OS, a startup opportunity - Mobile Startups Toronto & HTML Toronto me...
Firefox OS, a startup opportunity - Mobile Startups Toronto & HTML Toronto me...Firefox OS, a startup opportunity - Mobile Startups Toronto & HTML Toronto me...
Firefox OS, a startup opportunity - Mobile Startups Toronto & HTML Toronto me...Frédéric Harper
 
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...Robert Nyman
 
Advantages and limitations of PhoneGap for sensor processing
Advantages and limitations of PhoneGap for sensor processingAdvantages and limitations of PhoneGap for sensor processing
Advantages and limitations of PhoneGap for sensor processingGabor Paller
 
Camera And Email
Camera And EmailCamera And Email
Camera And EmailSV.CO
 
Using AIR for Mobile Development
Using AIR for Mobile DevelopmentUsing AIR for Mobile Development
Using AIR for Mobile DevelopmentVeronique Brossier
 
15 sensors and proximity nfc and bluetooth
15   sensors and proximity nfc and bluetooth15   sensors and proximity nfc and bluetooth
15 sensors and proximity nfc and bluetoothWindowsPhoneRocks
 
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22Frédéric Harper
 
Developing AIR for Android with Flash Professional
Developing AIR for Android with Flash ProfessionalDeveloping AIR for Android with Flash Professional
Developing AIR for Android with Flash ProfessionalChris Griffith
 
Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Massimo Oliviero
 
21 android2 updated
21 android2 updated21 android2 updated
21 android2 updatedGhanaGTUG
 
Alberto Guarino "When iPhones and Wearables Dance the Bluetooth Dance: Lesson...
Alberto Guarino "When iPhones and Wearables Dance the Bluetooth Dance: Lesson...Alberto Guarino "When iPhones and Wearables Dance the Bluetooth Dance: Lesson...
Alberto Guarino "When iPhones and Wearables Dance the Bluetooth Dance: Lesson...IT Event
 
Taming event-driven software via formal verification
Taming event-driven software via formal verificationTaming event-driven software via formal verification
Taming event-driven software via formal verificationAdaCore
 

Similaire à PhoneGap - Hardware Manipulation (20)

Error ontologies and altarica transformation aadl meeting florida jan 24-27
Error ontologies and altarica transformation   aadl meeting florida jan 24-27Error ontologies and altarica transformation   aadl meeting florida jan 24-27
Error ontologies and altarica transformation aadl meeting florida jan 24-27
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
 
W 0300 codingfor_life-batterylifethatis
W 0300 codingfor_life-batterylifethatisW 0300 codingfor_life-batterylifethatis
W 0300 codingfor_life-batterylifethatis
 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)
 
Non Conventional Android Programming En
Non Conventional Android Programming EnNon Conventional Android Programming En
Non Conventional Android Programming En
 
Mobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptMobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScript
 
Pandora FMS: Windows Phone 7 Agent
Pandora FMS: Windows Phone 7 AgentPandora FMS: Windows Phone 7 Agent
Pandora FMS: Windows Phone 7 Agent
 
Firefox OS, a startup opportunity - Mobile Startups Toronto & HTML Toronto me...
Firefox OS, a startup opportunity - Mobile Startups Toronto & HTML Toronto me...Firefox OS, a startup opportunity - Mobile Startups Toronto & HTML Toronto me...
Firefox OS, a startup opportunity - Mobile Startups Toronto & HTML Toronto me...
 
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 
Android wearpp
Android wearppAndroid wearpp
Android wearpp
 
Advantages and limitations of PhoneGap for sensor processing
Advantages and limitations of PhoneGap for sensor processingAdvantages and limitations of PhoneGap for sensor processing
Advantages and limitations of PhoneGap for sensor processing
 
Camera And Email
Camera And EmailCamera And Email
Camera And Email
 
Using AIR for Mobile Development
Using AIR for Mobile DevelopmentUsing AIR for Mobile Development
Using AIR for Mobile Development
 
15 sensors and proximity nfc and bluetooth
15   sensors and proximity nfc and bluetooth15   sensors and proximity nfc and bluetooth
15 sensors and proximity nfc and bluetooth
 
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
 
Developing AIR for Android with Flash Professional
Developing AIR for Android with Flash ProfessionalDeveloping AIR for Android with Flash Professional
Developing AIR for Android with Flash Professional
 
Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)
 
21 android2 updated
21 android2 updated21 android2 updated
21 android2 updated
 
Alberto Guarino "When iPhones and Wearables Dance the Bluetooth Dance: Lesson...
Alberto Guarino "When iPhones and Wearables Dance the Bluetooth Dance: Lesson...Alberto Guarino "When iPhones and Wearables Dance the Bluetooth Dance: Lesson...
Alberto Guarino "When iPhones and Wearables Dance the Bluetooth Dance: Lesson...
 
Taming event-driven software via formal verification
Taming event-driven software via formal verificationTaming event-driven software via formal verification
Taming event-driven software via formal verification
 

Plus de Doncho Minkov

Plus de Doncho Minkov (20)

Web Design Concepts
Web Design ConceptsWeb Design Concepts
Web Design Concepts
 
Web design Tools
Web design ToolsWeb design Tools
Web design Tools
 
HTML 5
HTML 5HTML 5
HTML 5
 
HTML 5 Tables and Forms
HTML 5 Tables and FormsHTML 5 Tables and Forms
HTML 5 Tables and Forms
 
CSS Overview
CSS OverviewCSS Overview
CSS Overview
 
CSS Presentation
CSS PresentationCSS Presentation
CSS Presentation
 
CSS Layout
CSS LayoutCSS Layout
CSS Layout
 
CSS 3
CSS 3CSS 3
CSS 3
 
Adobe Photoshop
Adobe PhotoshopAdobe Photoshop
Adobe Photoshop
 
Slice and Dice
Slice and DiceSlice and Dice
Slice and Dice
 
Introduction to XAML and WPF
Introduction to XAML and WPFIntroduction to XAML and WPF
Introduction to XAML and WPF
 
WPF Layout Containers
WPF Layout ContainersWPF Layout Containers
WPF Layout Containers
 
WPF Controls
WPF ControlsWPF Controls
WPF Controls
 
WPF Templating and Styling
WPF Templating and StylingWPF Templating and Styling
WPF Templating and Styling
 
WPF Graphics and Animations
WPF Graphics and AnimationsWPF Graphics and Animations
WPF Graphics and Animations
 
Simple Data Binding
Simple Data BindingSimple Data Binding
Simple Data Binding
 
Complex Data Binding
Complex Data BindingComplex Data Binding
Complex Data Binding
 
WPF Concepts
WPF ConceptsWPF Concepts
WPF Concepts
 
Model View ViewModel
Model View ViewModelModel View ViewModel
Model View ViewModel
 
WPF and Databases
WPF and DatabasesWPF and Databases
WPF and Databases
 

Dernier

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Dernier (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

PhoneGap - Hardware Manipulation

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. Connection API (3) function checkConnection() {     var networkState = navigator.network. connection.type ;     var states = {};     states[ Connection .UNKNOWN]  = 'Unknown connection';     states[ Connection .ETHERNET] = 'Ethernet connection';     states[ Connection .WIFI]     = 'WiFi connection';     states[ Connection .CELL_2G]  = 'Cell 2G connection';     states[ Connection .CELL_3G]  = 'Cell 3G connection';     states[ Connection .CELL_4G]  = 'Cell 4G connection';     states[ Connection .NONE]     = 'No network connection';     alert(' Connection type: ' + states[networkState]); } checkConnection();
  • 9.
  • 10.
  • 11.
  • 12. The pause/resume events (2) document.addEventListener("pause", onPause, false); document.addEventListener("resume", onResume, false); function onPause() { navigator.compass.clearWatch(compassId); } function onResume() { compassId = navigator.compass .watchHeading( function (heading) { // do something }); }
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.

Notes de l'éditeur

  1. Когато PhoneGap се инициализира, той създава няколко обекта (повечето от тях в window.navigator), за да подпомогне комуникацията между вашата апликация и устройството под нея. { name: Може също да върне име на продукта в Андроид или името на собственика на телефона в iOS, platform: iOS връща iPhone като име на операционната си система вместо правилното iOS , уникалният идентификатор се генерира по различен начин на всяка платформа version: Windows Phone връща пълната версия , например 7.10.xxxx }
  2. Alert и Confirm се предоставени като заместници на системните такива диалози, за да може да се промени изгледът им (имена на бутони, заглавие). Някои платформи не спират изпълнението на джаваскрипт когато показват системните диалози и това е добър начин за заобикалянеъо на този проблем. Във Windows Phone бутоните не могат да се променят. Във iOS PhoneGap игнорира аргументите на vibrate() и beep() – файлът трябва да е по-къс от 30 секунди и да се намира във главната директория на HTML приложението със името beep.wav
  3. Има и изключения – някои мобилни операционни системи не спират изпълнението на апликациите и те продължават да работят в background.
  4. altitudeAccuracy не се поддържа в Android и винаги ще върне null.
  5. Аргумента allowEdit е достъпен само в iOS. quality, mediaType и sourceType се игнорират в BlackBerry Palm encodingType не се поддържа в Android
  6. Категориите се поддържат само в BlackBerry и то само отчасти .