Future-Proof Your Windows 7 Apps with Touch and Location

If the release of the iPhone nearly three years ago was the birth of the multi-touch interface revolution on mobile devices, then the recent release of its larger sibling, the iPad, could very well go down as the birth of multi-touch in full-size applications. Now, don't go telling me about all of the different places that used multi-touch before the iPhone and the iPad. The bottom line is that nothing multi-touch had gone mainstream before these two breakout products.

 In a very short period of time, multi-touch went from “nice to have” to practically mandatory, if you want your application to remain relevant past the next year or so. The good news is that you can ride the multi-touch wave with your own applications on Windows 7 (followed soon after by Windows Phone 7). It's easy to multi-touch enable your applications with Visual Studio 2010 and .NET 4.

 For example, you can set the IsManipulationEnabled property of any UIElement to true, and then instantly wire into touch events such as ManipulationStarting and ManipulationCompleted. If you want even greater control over the touch experience, you can handle the TouchDown, TouchEnter, TouchLeave, TouchMove, and TouchUp events. There are even events like ManipulationInertiaStarting that allow you to introduce proper physics to the way user interface elements interact with your fingers and with each other. The best part is that the behavior will gracefully downgrade when executed on older operating systems. You can also check whether multi-touch is supported in code if you want even greater control.

 Speaking of code, another way that you can easily control the behavior of your Windows 7 applications using Visual Studio 2010 and .NET 4 is via the Location API. With smaller and smaller hardware, it is increasingly likely that the users of your application will be “on the go.” The more aware that your application is of where the user is, the more enhanced an experience you can offer up to them.

 The Location API is the only part of the Windows 7 Sensor and Location Platform that was implemented in .NET 4, but what a great one to pick! Essentially, the Location API abstracts the developer from the particulars of the hardware that determines the user's location (e.g., GPS, WiFi, or cell tower triangulation). All you care about is whether the API can figure out where the user currently is: You can do something cool with that knowledge. Your code might look something like this:

 

GeoCoordinateWatcher watcher = new
	GeoCoordinateWatcher();
watcher.TryStart(false,
	TimeSpan.FromMilliseconds(1000));
GeoCoordinate coord = watcher.Position.Location;
if (coord.IsUnknown != true)
\\{
	//do something cool with
	//coor.Latitude and coord.Longitude
\\}

 

Think about how awesome it would be if your application didn't have to ask the user where she is in order to show her options that make sense for her circumstances. Just that little detail can make your application so much more pleasurable to use.

 If you make your application easier through a well-thought-out multi-touch interface, and you make it more location-aware using the Location API, your application stands a good chance of being successful in the ever more competitive software marketplace. After all, anybody can make a good application with today's software development tools. Great applications, however, are still relatively rare. It's the fit and finish that counts.

 Multi-touch and location awareness are available in Windows 7, but there is also a better than average chance that Microsoft will release an "iPad-like" device powered by the Windows Phone OS. If and when that happens, your application will more easily take root if it has multi-touch and location awareness already in its DNA.

 With touch in the ascendency what does this mean for pen/stylus? I wouldn't completely dismiss it as an input mechanism for your applications. Microsoft is still hanging onto the pen as a potentially game-changing differentiator in the mobile application landscape. Personally, I don't want or need a pen, so I'm biased in favor of multi-touch only interfaces. For certain niche use cases like drawing, signing documents, or detailed visual object manipulation a pen interface could be useful, though. I just wouldn't invest heavily in pen unless you fall into one of those categories. Spend your time building a UI/UX that just begs to be touched, and that is easy enough to use that a four year old child can do it. My four year old knows more about my iPhone than I do, so I know it's not an impossible goal to achieve.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish