Device,Network, Vibration, Console, Accelerometer

Slides:



Advertisements
Similar presentations
Contents Different O.S. and platforms. Different programming languages. Possibilities for mobiles. GPS, digital compass, accelerometer,… Augmented reality.
Advertisements

Android Power Calculations Approaches and Best Practice Hafed Alghamdi.
Intro to Android and iOS CS-328 Dick Steflik. The Players Android – Open source mobile OS developed ny the Open Handset Alliance led by Google. Based.
By Amelia Hart.  Both have a lot in common:  1. Both are Linux-based operating systems for smartphones that have been put together by companies best.
Tablet Computers Georgia 4- H Cotton Boll and Consumer Judging 2013.
Devices 1 billion smartphones by 2016, 350M of those being used at work People 82 % of the world's online population engages in social networking Cloud.
Building Sensor-based Apps Windows Phone Windows Store Windows Desktop
INTRODUCTION TO MOBILE COMPUTING. MOBILE COMPUTING  Mobile computing is the act of interacting with a computer through the use of a mobile device. 
CHAP 4. GEOLOCATION API.  You can request users to share their location and, if they agree, you can provide them with instructions on how to get to a.
Lecture # 9 Hardware Sensor. Topics 2  SensorManger & Sensor  SensorEvent & SensorEventListener  Example Application.
INTRODUCTION TO HTML5 Geolocation. Display a Specific Location with Google Maps  You can use the Google Maps API to display a custom map on your own.
DUE Introduction to the Android Platform Working Connections 2011.
What is Android……? Android is an Operating System (OS) created by Google to run on any small electronic devices such as cell phones, e- books, Media Internet.
Mobile web Sebastian Lopienski IT Technical Forum 29 June 2012.
Phonegap Bridge – Compass API CIS 136 Building Mobile Apps 1.
Phonegap Bridge – File System CIS 136 Building Mobile Apps 1.
Basics of testing mobile apps
Sensors in android. App being more applicable Keeping track of your heart beat while jogging. Pointing the phone camera towards the night sky to know.
Phonegap Bridge – Device, Network, Console, Geolocation API’s CIS 136 Building Mobile Apps 1.
1 REMOTE CONTROL SYSTEM V7 2 Introduction.
 Follow the steps in order to solve the sync issue with the best fitness trackers;best fitness trackers  1. Reboot your Fitness Tracker and the device.
JavaScript, Sixth Edition
Phonegap Bridge –Geolocation and Google maps CIS 136 Building Mobile Apps 1.
Understanding Mobile Devices, Interactions, and Tools Lesson 1.
Phonegap Bridge – Device,Network, Vibration,Battery,Console CIS 136 Building Mobile Apps 1.
Accelerometer based motion gestures for mobile devices Presented by – Neel Parikh Advisor Committee members Dr. Chris Pollett Dr. Robert Chun Dr. Mark.
CPE 490/590 – Smartphone Development
How to Sync Android Phone to Computer (PC/Mac)? Are you a person that always has your Android phone in your hands? Nowadays, a cell phone is not just for.
Mobile Computing Lecture#01 Mobile Horizon. Leading Mobile Phone Technologies  iOS  Android  Blackberry  Symbian  Windows Phone  J2ME.
Phonegap Bridge – Storage CIS 136 Building Mobile Apps 1.
QML and JavaScript for Native App Development Michael Tims Jen Trieu.
Version of the document: 1.01 Software Version CBox: v3.7.1 Hardware Version CBox: C5 Remote Access Configuration Client Language: English.
TIZEN STUDIO INSTALLATION & ENVIRONMENT SETUP FOR DEVLAB
Software Engineering in Mobile Application Development
Vijay Kumar Kolagani Dr. Yingcai Xiao
REDCap Mobile Application
Mobile Application Development BSCS-7 Lecture # 1
Pilot Walktour Pack Operation Guide V3.4
ET-570 Smart Phone Apps.
App Inventor إعدادأشرف رفاعي أحمد
WELCOME Mobile Applications Testing
CSCI 351 – Mobile Applications Development
System Software EIT, © Author Gay Robertson, 2016.
Data Transport for Online & Offline Processing
Mobile Application Test Case Automation
DCR ARB Presentation Team 5: Tour Conductor.
CIS 136 Building Mobile Apps
Development-Introduction
Geolocation using Google maps
Vijay Kumar Kolagani Dr. Yingcai Xiao
CIS 136 Building Mobile Apps
CSCI 351 – Mobile Applications Development
CIS 136 Building Mobile Apps
Webex Classes in Mobile
Google Chromecast.
Introduction to Mobile Devices
Different Types of Apps. App Development ● App Development refers to the creation of computer applications for use on mobile devices such as tablets,
PRESENTATION 1.0 BY – SAFEEBOOK Web browsers.
CIS 136 Building Mobile Apps
Geolocation using Google maps
CIS 136 Building Mobile Apps
Phonegap Bridge Configuration file
CIS 136 Building Mobile Apps
Android Topics Sensors Accelerometer and the Coordinate System
Apache Cordova What is it ? Platforms Development Architecture Plugins
CIS 136 Building Mobile Apps
Chapter 2 Ionic Installation
Mobile Computing Lecture Materials By Bintang Eka Putera.
Device,Network, Vibration, Console, Accelerometer
Geolocation using Google maps
Presentation transcript:

Device,Network, Vibration, Console, Accelerometer CIS 136 Building Mobile Apps

Device

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

Device Plug-in cordova property Gets the version of Cordova running on the device $(document).on(“deviceready", function() { $(‘#info’).html(device.cordova); });

Device Plug-in platform property Gets the operating system name "Android" "BlackBerry 10" "browser" "iOS" "WinCE" "Tizen" "Mac OS X" $(document).on(“deviceready", function() { $(‘info’).html(device.platform); });

Device Plug-in manufacturer property Gets the Manufacturer Android: Motorola XT1032 would return "motorola" BlackBerry: returns "BlackBerry" iPhone: returns "Apple" $(document).on(“deviceready", function() { $(‘info’).html(device.manufacturer); }

Device Plug-in model property Gets 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 Android: Nexus One returns "Passion" (Nexus One code name) Motorola Droid returns "voles" iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1 $(document).on(“deviceready", function() { $(‘info’).html(device.model); });

Device Plug-in 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. $(document).on(“deviceready", function() { $(‘info’).html(device.uuid); });

Device Plug-in version property Gets the operating system version Android: Pie OS would return “9.0" Lollipop OS would return “5.0“ or “5.1.1 iPhone: iOS returns “12.2" Windows Phone : Windows 10 Mobile, version 1709 (after 12/10/19 windows mobile will be discontinued) $(document).on(“deviceready", function() { $(‘info’).html(device.version); });

Device Plug-in isVirtual property Determines whether the device is running on a emulator $(document).on(“deviceready", function() { $(‘info’).html(device.isVirtual); };

Device Plug-in serial property Gets the serial number $(document).on(“deviceready", function() { $(‘info’).html(device.serial); });

Console

Cordova Console Plugin log() – writes messages to the console $(document).on("deviceready", function() { console.log(“message to console – Hello there”); });

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 which has 9 values: "bluetooth“ "cellular“ "ethernet“ "mixed“ "none“ "other“ "unknown“ "wifi“ "wimax“ If cellular, the connection.effectiveType property will distinguish between "2g", "3g", "4g", and "slow-2g"

navigator.connection.type determine the device's type of connection Ex: $(document).on(“deviceready", function() { var nettype = navigator.connection.type; $(‘info’).html(nettype); });

Network related events offline - fires when an application goes offline, and the device is not connected to the Internet $(document).on(“offline", function() { }); online - fires when an application goes online, and the device becomes connected to the Internet $(document).on(“online", function()

Vibration

Vibration Plug-in provides a way to vibrate the device using the navigator.vibrate() method Parameters passed to it alter the vibration pattern One long vibration Syntax: navigator.vibrate(duration) where duration is specified in milliseconds Example: navigator.vibrate(2000); Several vibrations with a pause in between : Syntax: navigator.vibrate(duration,pause[,duration,pause,duration,pause, etc]) Example: navigator.vibrate([1000,2000,3000,1000,5000]);

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

Accelerometer

Accelerometer Modern mobile phones come with a variety of sensors that automate many of our daily tasks Accelerometers in mobile phones are used to measure the tilting motion and orientation of a mobile phone Applications: When you use a compass app on your smartphone, it somehow knows which direction the phone is pointing Apps that calculate the steps you take whether you’re walking, jogging or running Detection of earthquakes https://vimeo.com/2182220

Accelerometer the device's accelerometer is a motion sensor that detects the change (delta) in movement relative to the current device orientation, in three dimensions along the x, y, and z axis Methods navigator.accelerometer.getCurrentAcceleration() navigator.accelerometer.watchAcceleration() navigator.accelerometer.clearWatch() Has success and fail callbacks If the method is successful, it returns an acceleration data object If the method fails, it returns an error object

Acceleration data object data captured at a specific point in time Acceleration values include the effect of gravity (9.81 m/s^2), so that when a device lies flat and facing up, x, y, and z values returned should be 0, 0, and 9.81. Properties x: Amount of acceleration on the x-axis. (in m/s^2) (Number) y: Amount of acceleration on the y-axis. (in m/s^2) (Number) z: Amount of acceleration on the z-axis. (in m/s^2) (Number) timestamp: Creation timestamp in milliseconds. (DOMTimeStamp)

Accelerometer – getCurrentAcceleration() navigator.accelerometer.getCurrentAcceleration(onSuccess, onError); function onSuccess(acceleration) { alert('Acceleration X: ' + acceleration.x + 'Acceleration Y: ' + acceleration.y + 'Acceleration Z: ' + acceleration.z + 'Timestamp: ' + acceleration.timestamp ); }; function onError(error) { alert(“an error occurred – “ + error.code);

Accelerometer – watchAcceleration() Retrieves the device's current Acceleration at a regular interval Executes the Success callback function each time Specify the interval in milliseconds via the Options object's frequency parameter Returns a watch ID which references the accelerometer's watch interval, and can be used with navigator.accelerometer.clearWatch to stop watching the accelerometer. var watchID = navigator.accelerometer.watchAcceleration(onSuccess,onError,options); options period: requested period of calls to accelerometerSuccess with acceleration data in Milliseconds. (Number) (Default: 10000)

Accelerometer – watchAcceleration() - example var options = { frequency: 3000 }; // Update every 3 seconds var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options); function onSuccess(acceleration) { alert('Acceleration X: ' + acceleration.x + 'Acceleration Y: ' + acceleration.y + 'Acceleration Z: ' + acceleration.z + 'Timestamp: ' + acceleration.timestamp ); }; function onError() { alert(‘An Error occurred!');

Accelerometer – clear watch Stop watching the Acceleration being watched navigator.accelerometer.clearWatch(watchID); var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options); // ... later on ...