CIS 136 Building Mobile Apps

Slides:



Advertisements
Similar presentations
Welcome to the Award Winning Easiest to Use & Most Advanced View, Manage, and Control Security, Access Control, Video, Energy & Lighting Systems, & Critical.
Advertisements

Fundamentals of Python: From First Programs Through Data Structures
Phonegap Bridge – Battery API CIS 136 Building Mobile Apps 1.
1 Semester 2 Module 2 Introduction to Routers Yuda college of business James Chen
1 Semester 2 Module 3 Configuring a Router Yuda college of business James Chen
Phonegap Bridge – File System CIS 136 Building Mobile Apps 1.
Building Native Mapping Apps with PhoneGap: Advanced Techniques
Internet Addresses. Universal Identifiers Universal Communication Service - Communication system which allows any host to communicate with any other host.
Cisco S2 C4 Router Components. Configure a Router You can configure a router from –from the console terminal (a computer connected to the router –through.
Part 1: Android Gateway In this part of the manual, we will learn about the Android Gateway: This includes: How to maintain your Android Gateway See if.
Convenience product security Collin Busch. What is a convenience product? A convenience product is a device or application that makes your life easier.
Phonegap Bridge – Device, Network, Console, Geolocation API’s CIS 136 Building Mobile Apps 1.
Hands-On Microsoft Windows Server 2008 Chapter 5 Configuring Windows Server 2008 Printing.
The VERSO Product Returns Portal Incorporates Office 365 Outlook and Excel Add-Ins to Create Seamless Workflow for All Participating Users OFFICE 365 APP.
Office 365 is cloud- based productivity, hosted by Microsoft. Business-class Gain large, 50GB mailboxes that can send messages up to 25MB in size,
Phonegap Bridge –Geolocation and Google maps CIS 136 Building Mobile Apps 1.
Phonegap Bridge – Device,Network, Vibration,Battery,Console CIS 136 Building Mobile Apps 1.
IPEmotion License Management PM (V1.2).
Enterprise | education | public printing locations PrinterOn for Manufacturing.
Phonegap Bridge – Storage CIS 136 Building Mobile Apps 1.
Introduction to networking (Yarnfield) Configure a router.
Version of the document: 1.01 Software Version CBox: v3.7.1 Hardware Version CBox: C5 Remote Access Configuration Client Language: English.
What does LinkConnect do?
REDCap Mobile Application
PhoneGap, Processing.
Pilot Walktour Pack Operation Guide V3.4
Welcome POS Synchronize Concept 08 Sept 2015.
DEVICE ORIENTATION ICT4D Session 2.
Office 365 is cloud-based productivity, hosted by Microsoft.
WELCOME Mobile Applications Testing
What is a Firewall?.
Resource Management IB Computer Science.
Pilot Walktour Pack Operation Guide V3.2
Android System Security
Using SHOPFLOOR with QUALITY control
Mobile Application Development
Model NO: MTZ-A0003.
AUTOMATED security system
CIS 136 Building Mobile Apps
Activities and Intents
Officeatwork 365 Document Designer Allows Organizations to Design Brand- and Legal- Compliant Templates and Documents Globally OFFICE 365 APP BUILDER PROFILE:
in All Office 365 Apps for Enterprise Companies
Booklet365 Office 365 Outlook Add-In Makes Easy Work of Managing Schedules for Fitness Gyms, Sports Associations, Trainers, and Their Customers Partner.
Geolocation using Google maps
Introduction to Computers
CIS 136 Building Mobile Apps
Introduction to Computers
S ERVICE N OW T UTORIAL. W HAT I S S ERVICENOW ?? This opening Servicenow tutorial picks out the most significant foundations of ServiceNow, starting.
Introduction to Mobile Devices
RR RR Problems Along With Solutions For iPhone And iPad Toll Free ( )
Install and Run the Kronos Mobile App
Java Byte IPC: Part 6-Summary
It’s About Time – ScheduleMe Outlook Add-In for Office 365 Enables Users to Schedule Meetings Easily with People Outside of Your Organization Partner Logo.
Configuring a Router Module 3 Semester 2.
CIS 136 Building Mobile Apps
Built on the Powerful Microsoft Office 365 Platform, My Intranet Boosts Efficiency with Support of Daily Tasks, Internal Communications and Collaboration.
Geolocation using Google maps
CIS 136 Building Mobile Apps
Phonegap Bridge Configuration file
CIS 136 Building Mobile Apps
Product Overview.
Computer communications
Yooba File Sync: A Microsoft Office 365 Add-In That Syncs Sales Content in SharePoint Online to Yooba’s Sales Performance Management Solution OFFICE 365.
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Device,Network, Vibration, Console, Accelerometer
Device,Network, Vibration, Console, Accelerometer
Geolocation using Google maps
Product Overview.
Chit fund software, Online Chit fund software,chit fund management software,chit fund accounting software,android chit fund software,chit fund software online
Presentation transcript:

CIS 136 Building Mobile Apps Device,Network, Vibration,Battery,Console https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-network-information/index.html CIS 136 Building Mobile Apps

Device

Device Plug-in org.apache.cordova.device describes the device's hardware and software Global in scope, but not available until the device is ready Device object has 5 properties cordova model platform uuid Version Manufacturer isVirtual serial

Device Object cordova property Gets the version of Cordova running on the device Ex: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { $(‘#info’).html(device.cordova); }

Device Object model property Gets the the name of the device's model or product set by the device manufacturer and may be different across versions of the same product Might get the production code name Ex: Android: Nexus One returns "Passion" (Nexus One code name) Motorola Droid returns "voles" BlackBerry: Torch 9800 returns "9800" iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { $(‘info’).html(device.model); }

Device Object platform property Gets the operating system name Ex: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { $(‘info’).html(device.platform); }

Device Object uuid property Gets the Universally Unique Identifier a 128-bit value that is ‘practically unique’ determined by the device manufacturer and are specific to the device's platform or model. Ex: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { $(‘info’).html(device.uuid); }

Device Object manufacturer property Gets the operating system version Kitkat 4.4.4 Ex: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { $(‘info’).html(device.version); }

Device Object isVirtual property Determines Ex: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { $(‘info’).html(device.isVirtual); }

Device Object serial property Gets the serial number Ex: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { $(‘info’).html(device.serial); }

Device Object version property Gets the operating system version Kitkat 4.4.4 Ex: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { $(‘info’).html(device.version); }

Network

Network Information Plug-in Navigator.connection provides information about the device's cellular and wifi connection Indicates if the device has an internet connection Connection Object has 1 property -connection.type connection.type has 8 values, available as constants connection.type Connection.UNKNOWN Connection.ETHERNET Connection.WIFI Connection.CELL_2G Connection.CELL_3G Connection.CELL_4G Connection.CELL Connection.NONE

navigator.connection.type determine the device's network connection state, and type of connection Ex: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { var networkState = navigator.connection.type; $(‘info’).html(networkState); }

Network States Using the type of connection, coupled with the translation of network state constants, can provide a textual description document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { var networkState = navigator.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.CELL] = 'Cell generic connection'; states[Connection.NONE] = 'No network connection'; $(‘info’).html(states[networkState]); }

Network related events offline - fires when an application goes offline, and the device is not connected to the Internet document.addEventListener("offline", yourCallbackFunction, false); online - fires when an application goes online, and the device becomes connected to the Internet document.addEventListener("online", yourCallbackFunction, false);

Vibration

Vibration provides a way to vibrate the device navigator.vibrate object Three different functionalities based on parameters passed to it Standard Vibration: vibrate(duration) duration is specified in milliseconds navigator.vibrate(2000); Pattern Vibration: Sequence of durations (in milliseconds) for which to turn on or off the vibrator To make a device vibrate, pause, then vibrate again, need to call vibrate several times and force the app to pause in between navigator.vibrate([1000,2000,3000,1000,5000]);

Vibration Cancel Vibration: Pass in a parameter of 0, an empty array, or an array with one element of value 0  vibrate(0) vibrate([]) Vibrate([0])

Battery

Battery Status Plug-in org.apache.cordova.battery-status a means for web developers to programmatically determine the battery status of the hosting device and whether the device is plugged in or not without knowing the battery status of a device, you are designing the web application with the assumption there is sufficient battery level for the task at hand battery of a device may exhaust faster than expected if apps are unable to make decisions based on the battery status given knowledge of the battery status, web developers are able to craft web content and applications which are power- efficient, thereby leading to improved user experience

Battery Status Plug-in Battery Status events can be used to defer or scale back work when the device is not plugged in or is low on battery Ex: In an advanced application, like an email app, the app can check the server for new email every few seconds if the device is plugged in, but do so less frequently if the device is not plugged in or is low on battery In an advanced application, like a note keeper, the app could monitor the battery level and save changes before the battery runs out to prevent data loss

Battery Status Events BatteryStatus events are fired when charge percentage changes by at least 1 percent when the device is plugged in or unplugged This event returns an object containing the battery status, which scales from critical to ok Battery Status Object has the following properties: isPlugged (Boolean) whether the device is plugged in level (float) Represents how much of the internal power source remains, scaled from 0 to 100 (null if no juice)

Battery Status Events Critical Low OK null - unable to report the battery's level threshold values are device-specific.

Battery Status Example The battery status handler is passed an object that contains two properties: level: The percentage of battery charge (0-100) isPlugged: A boolean that indicates whether the device is plugged in use an EventListener to attach an event handler after the deviceready event fires window.addEventListener("batterystatus", onBatteryStatus, false); function onBatteryStatus(info) console.log("Level: " + info.level + " isPlugged: " + info.isPlugged); }

Battery Critical The event fires when the percentage of battery charge has reached the critical battery threshold The value is device-specific

Battery Critical Example The batterycritical handler is passed an object that contains two properties: level: The percentage of battery charge (0-100) isPlugged: A boolean that indicates whether the device is plugged in window.addEventListener("batterycritical", onBatteryCritical, false); function onBatteryCritical(info) { alert("Battery Level Critical " + info.level + "%\nRecharge Soon!"); }

Battery Low This event fires when the percentage of battery charge has reached the low battery threshold device-specific value

Battery Low Example The batterylow handler is passed an object that contains two properties: level: The percentage of battery charge (0-100) isPlugged: A boolean that indicates whether the device is plugged in window.addEventListener("batterylow", onBatteryLow, false); function onBatteryLow(info) { alert("Battery Level Low " + info.level + "%"); }

Console

Cordova Console Plugin cordova-plugin-console log() – writes messages to the console document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { console.log(“message to console – Hello there”); }