Is there a method I can call to see if I am 开发者_如何学编程currently running in the emulator vs. running on an actual physical phone?
I need to run some code a bit differently when I am in the emulator (I have a mock gps location service).
You can get this from Microsoft.Devices.Environment.DeviceType
if (System.Environment.DeviceType == DeviceType.Emulator)
{
}
Hope that helps
For wp 7.5 Mango sdk, it has moved to the namespace Microsoft.Devices
if (Microsoft.Devices.Environment.DeviceType == DeviceType.Emulator)
{
//Do Stuff
}
精彩评论