开发者

API call to check if running in emulator wp7

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜