Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Windows Phone testing for sensors

DZone's Guide to

Windows Phone testing for sensors

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

If you are planning on using the new sensors that are in the Windows Phone code named Mango (Gyroscope, Compass, etc…), you need to add some code to your application to test and see if they are available.  You can use the Microsoft.Devices.Sensors namespace to find this out.

bool IsGyroSupported = Microsoft.Devices.Sensors.Gyroscope.IsSupported;

bool IsAccelerometerSupported = Microsoft.Devices.Sensors.Accelerometer.IsSupported;

bool IsCompassSupported = Microsoft.Devices.Sensors.Compass.IsSupported;

bool IsMotionSupported = Microsoft.Devices.Sensors.Motion.IsSupported; 

The Motion Sensor is the API that combines all the other sensors and adds some math to make it easier to build your application using sensors

Source: http://thesociablegeek.com/2011/10/13/windows-phone-testing-for-sensors/

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}