Sample Application: Windows* 8 Sensors (All in One)

This sample application shows how to create a Windows* 8 Store app that will display the data outputs of the various sensors on the platform. It uses the Windows Runtime sensor APIs to register callback functions that report sensor input to the application. The application is written in JavaScript* and it displays the textual output of the data reported by the accelerometer, compass, gyroscope, light, inclinometer, orientation, and Geo-location sensor APIs. This basic application should be helpful to developers who are looking for an example of how to effectively use the Windows* Runtime APIs to register for sensor event notifications in their Windows* Store app.

Download Source Code

Windows 8 Sensors Sample Demo

Intel sample sources are provided to users under the Intel Sample Source Code License Agreement.

About the Author
Gideon is a Software Applications Engineer with Intel's Software and Solutions Group. Gideon has spent 5 years developing display controller components of Windows, Linux, and Android graphics drivers. For the last year, he has worked on Windows 8 and Android applications for Intel’s tablet and phone platforms.

Downloadapplication/zip sensors.zip36.85 KB
For more complete information about compiler optimizations, see our Optimization Notice.


This sample assumes that the

This sample assumes that the sensors are present on the platform you're running it on. It's possible that your platform doesn't have one of the sensors (light for instance) and is returning a null pointer reference to the light sensor object. If that's the case, when that object is dereferenced to access teh minimumReportInterval value, you'll get a null pointer reference. You could add null pointer checking code or simply comment out support for the sensors that aren't present on your platform.