A Device API Safari - Web Directions Code 2014
-
Upload
andrew-fisher -
Category
Technology
-
view
553 -
download
0
description
Transcript of A Device API Safari - Web Directions Code 2014
A Device API Safari
Andrew Fisher @ajfisher
Web Directions Code 1 May, 2014
Where the wild APIs live
Sensor API
Ambient Temperature
Ambient Humidity
Atmospheric Pressure
Sensor based content
Upgrade your NodeBot
Web NFC
Web NFC
Network APIs
Proximity API
DeviceProximityEvent
UserProximityEvent
DeviceProximityEvent
Event Object:
value; // distance detected
max; // maximum distance capable
min; // minimum distance capable
UserProximityEvent
Event Object:
near; // true if inside detection zone
Battery Status API
Battery Status API
chargingchange
chargingtimechange
dischargingtimechange
levelchange
Battery Status API
BatteryManager Object:
charging; // true if charging
chargingTime; // time to fully charged in seconds
dischargingTime; // time to flat in seconds
level ; // percent charged
[0..1]
ajf.io/wdc_battery
Leaving the wilderness
Vibration API
navigator.vibrate(msec);
navigator.vibrate([msec on, msec off, msec on, msec off..]);
navigator.vibrate(0);
ajf.io/wdc_racer
(video) https://www.youtube.com/watch?v=0AC_InC0QMA
ajf.io/wdc_vibroform
Ambient Light API
DeviceLight Event
Event Object:
value; // amount of light from sensor in lux
ajf.io/wdc_contrast
ajf.io/wdc_contrast