Advanced Windows 8 App Development Using JavaScript Jump Start Exam Prep M2: Hardware and Sensors Michael Palermo Microsoft Technical Evangelist Jeremy Foster Microsoft Developer Evangelist
Jump Start Target Agenda Advanced Windows 8 Apps Using JavaScript Module 1: Background Tasks and Components Module 2: Hardware and Sensors Module 3: Printing and PlayTo MEAL BREAK Module 4: Animations, Custom Controls, and Globalization Module 5: Data, Files, and Encryption Module 6: Deployment
Module Agenda Capture media with the camera and microphone Get data from sensors Enumerate and discover device capabilities ˃ ˃
Capturing from camera The easy way… CameraCaptureUI The powerful way… MediaCapture
CODESHOW: MEDIA CAPTURE demo
Module Agenda Capture media with the camera and microphone Get data from sensors Enumerate and discover device capabilities ˃ ˃
Sensors
Light sensor //get access to the default light sensor var lightSensor = Windows.Devices.Sensors.LightSensor.getDefault(); //implement the readingchanged event lightSensor.onreadingchanged = function (e) { e.reading.illuminanceInLux; };
Compass //get access to the default compass var compass = Windows.Devices.Sensors.Compass.getDefault(); //implement the readingchanged event compass.onreadingchanged = function (e) { e.reading.headingTrueNorth; };
Accelerometer //get access to the default accelerometer var accelerometer = Windows.Devices.Sensors.Accelerometer.getDefault(); //implement the readingchanged event accelerometer.onreadingchanged = function (e) { e.reading.accelerationX; e.reading.accelerationY; e.reading.accelerationZ; };
Accelerometer - shake //get access to the default accelerometer var accelerometer = Windows.Devices.Sensors.Accelerometer.getDefault(); //implement the readingchanged event accelerometer.onshaken = function (e) { //TODO: rattle and roll };
CODESHOW: GEOLOCATION demo
Module Agenda Capture media with the camera and microphone Get data from sensors Enumerate and discover device capabilities ˃ ˃
Enumerating devices Windows.Devices.Enumeration namespace
CODESHOW: DEVICES demo
Discovering device capabilities Geolocation Removable storage Accelerometer
CODESHOW: DISCOVER demo
Summary Capture media with the camera and microphone Get data from sensors Enumerate and discover device capabilities