开发者

API call to check if running in emulator wp7

开发者 https://www.devze.com 2023-01-27 08:48 出处:网络
Is there a method I can call to see if I am 开发者_如何学编程currently running in the emulator vs. running on an actual physical phone?

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
}
0

精彩评论

暂无评论...
验证码 换一张
取 消