This post will give you an overview on how to identify the sensors supported on your Windows Phone. As a developer when you are developing for Windows Phone – and your application would need to interact with certain sensors in windows phone to achieve a certain functionality, you would need to verify whether the sensors are supported in targeted devices.
Windows Phone 8 platform has support for the following sensors
- Motion sensor
You can access these API’s through the below namespace:
You can check for any of the sensor support through “IsSupported” boolean property of the class
- Motion sensor [ Microsoft.Devices.Sensors.Motion ]
- Accelerometer [ Microsoft.Devices.Sensors.Accelerometer ]
- Compass [ Microsoft.Devices.Sensors.Compass ]
- Gyroscope [ Microsoft.Devices.Sensors.Gyroscope ]
Here is the sample code block:
public static string GetSensors()
StringBuilder sensorsList = new StringBuilder();
Note: Only Accelerometer is supported in Windows Phone 8 emulator. To test remaining capabilities, you would need to deploy the application on a real Windows Phone device.