Today, we are going to take a look at the Windows Simulator which ships with Visual Studio 11 and is used to debug Metro Style apps for Windows 8. I think it is important to learn about the features available in the simulator where we can better understand the way our Metro applications behave. It is also beneficial for those of us without access to a touch-screen monitor.
Before we start, you can check out all of my Windows 8 Articles here.
We have three ways to debug a Metro Application
1) By default, if you run a Visual Studio 11 Metro Application it will run on the local machine.
2) You can also select Remote Machine and you will be presented with the “Select Remote Debugger Connection” as shown below:
This option deserves it own blog post, so for the time being just be aware that it exists.
3) The third and final way is Simulator – Which is what we are going to explore today.
What’s the difference between a simulator and a emulator?
Let’s say you want to duplicate the behavior of an old HP calculator, there are two options:
You write new program that draws the calculator's display and keys, and when the user clicks on the keys, your programs does what the old calculator did. This is a Simulator
You get a dump of the calculator's firmware, then write a program that loads the firmware and interprets it the same way the microprocessor in the calculator did. This is an Emulator
The Simulator tries to duplicate the behavior of the device.
The Emulator tries to duplicate the inner workings of the device.
Back to the Simulator
If you place a check in Simulator and run your application, you will see the following:
What is important to note here is that this simulation is actually a Remote Desktop Session into your machine.
Don’t believe me? Hit the Windows Start Button in the Simulator and you will see your desktop. You can browse, execute, and do everything you normally do.
The key thing to note here is the Touch Controls located to the right of the screen. Here is a quick reference that I created defining each item:
Let’s start with the fourth item down.
As soon as you select Touch Emulation and return to the simulator you cursor will look like the following:
This mode will simulate the user swiping with a single finger – one contact.
Touch Emulation Pinch/Zoom
As soon as you select Touch Emulation Pinch/Zoom and return to the simulator you cursor will look like the following:
This mode will simulate the users using multiple fingers to pinch/zoom in – two contacts. If you click the left mouse button and rotate the wheel simultaneously, the Windows Simulator will send touch events to the target application as if the user was performing a Pinch/Zoom gesture on a physical touch device. See the illustration below:
Touch Emulation Rotate
This mode will simulate the users using multiple fingers to rotate – two contacts. Looks like the Pinch/Zoom when first selected but when you use the mouse wheel it actually rotates the two contact points relative to each other.
Both of these settings will allow you to rotate the screen +90/-90 degrees to the left or right.
This mode will simply allow us to change the resolution inside the simulator to test our apps against different size tablets. You can see the various options available below.
While this isn’t part of the touch control it is a handy tip. You can resize the simulator by clicking on the bottom right corner and dragging your mouse cursor as shown below.
As you can see from this post, the simulator is in a great shape starting from Day one. I normally wouldn’t expect this polished of a product until a later release. I believe this shows that Microsoft is committed to giving developers the right tools to build Metro applications. If you have any questions then feel free to contact me. Also, don’t forget to subscribe to my RSS feed and follow me on twitter.TweetFollow mbcrump
Last revised: 21 Dec, 2011 06:38 PM
No new comments are allowed on this post.