Navigate / search

Windows Phone: How to check if our application is run in an emulator?

From time to time there is a need to check how our application is being started – in emulator or in real device? To do this we need just to execute the following code:

if (Microsoft.Devices.Environment.DeviceType == DeviceType.Emulator)
{
  MessageBox.Show("Application has been started in emulator.");
}

With this knowledge we can change the way of our application’s behaviour on different type of devices. For example if our application is started in emulator we can use different settings for test purposes. Even more we can forbid our application to run on emulator. This feature can be useful also when we would like to show somebody (e.g. testers) that something cannot be tested in emulator, e.g. Bluetooth.

Keyboard shortcuts in WP8 emulator

Below you can find the list of keyboard’s shortcuts that can be used in Windows Phone 8 emulator:

– F12 (first press) – turns off and locks the display,
– F12 (second press) – shows lock screen,
– Page Down – enables to use keyboard connected to PC in emulator,
– Page Up – disables to use keyboard connected to PC in emulator,
– F1 – simulates pressing Back button,
– F2 – simulates pressing Start button,
– F3 – simulates pressing Search button.

The saved-state file … is corrupted

Sooner or later every one of us will get error as follows on the Windows Phone emulator:

Error: The saved-state file C:\ProgramData\Microsoft\XDE\{7F63A4C3-95DE-4DF2-91A9-AEC63BBDD089}.dess is corrupt. Please delete the corrupted saved state file and then retry.

The message will be almost the same. The only difference will be GUID. As you can see error is quite easy to solve because there is description what user should do. As soon as we remove files with the same GUID from provided directory, Windows Phone emulator will start. But… Read more