Harnessing WinRT APIs

Developers are gaining experience with Windows Runtime (WinRT), an API set that provides a framework for Windows 8 and Windows RT applications.

Microsoft provides the WinRT APIs for building Windows Store apps. Those apps differ from traditional desktop apps in a couple of ways. For instance, Windows Store apps incorporate a set of default styles that aim to make user interface components work well in touch scenarios, according to Microsoft. Supported languages include C++, C#, JavaScript and Visual Basic.

“There are several things that are significant for WinRT API,” says Ilya Kretov, delivery manager and Microsoft Certified Professional Developer at DataArt, a custom software development company.

For one, WinRT API provides the means to easily develop all the features the Windows 8 application needs to have, Kretov says. In addition, the API set is integrated into the operating system and provides a convenient and effective way of working with resources, he adds. “It is possible to develop fast native applications,” he says.

Kretov also notes that WinRT development has much in common with Windows Presentation Foundation (WPF) and Silverlight. That commonality makes it easy for any developer familiar with those technologies to master Microsoft’s newer offering, he says.

Michael Lake, vice president of engineering at WillowTree Apps Inc., a developer in Charlottesville, Va., suggests that making WinRT easy to pick up will be important for Microsoft in convincing developers to adopt its technology. “They really need to…make use of developers’ existing know-how,” he says. “Any time you ask developers to familiarize themselves with something new, that is going to mean more time, and more time means more money.”

WinRT Pluses
Brian Lagunas, product manager at Infragistics, a company that providers design and development tools and related services, says he has gained familiarity with the WinRT APIs and likes to use them on WPF applications.

“It is so much easier to access devices like webcams and audio devices” using WinRT versus Windows COM Interop, Lagunas says. Accomplishing tasks also requires less code when using WinRT APIs, he adds.

In a recent presentation at the 2013 Intel International Sales and Marketing Conference in Las Vegas, Eric Sardella, senior software engineer in Intel’s Software and Services Group, cited WinRT for its “rich set of multimedia high-level APIs available for Media Apps.” Sardella noted that the APIs capture audio and video from live sources, process image files, play/preview audio and video, and transcode video files. He says a WMV-to- MP4 transcoder involves just a few lines of code. [Disclosure: Intel is the sponsor of this content.]

Using WinRT to Exploit Sensors
Developers can also use WinRT to tap the numerous sensors built into Ultrabooks and other mobile platforms.

“WinRT makes the work with sensors more convenient than before,” Kretov says. “Previously, the only way to work with sensors was using the vendor’s API. This way is, obviously, device specific and in some cases it could be rather difficult to obtain all the necessary information. So, the sensor-related functionality should have been rewritten for different vendors' API during development and verified in course of configuration testing.”

DataArt has gained some experience with WinRT APIs. The company has been using them since July 2011, soon after the Windows 8 developer preview was released. “Since then, we have been following the evolution of the system and have already completed several projects,” Kretov says.

Sensor-related classes are available in the Windows devices. Sensors namespace include: Accelerometer, Compass, Gyrometer, Inclinometer, LightSensor and OrientationSensor.

Lagunas points out that, in order for WinRT to access those sensors, a sensor’s driver must be marked as PC-integrated.

Overall, mobile developers seem to view WinRT as a tool to make their jobs easier. Kretov says the fact that WinRT contains standard APIs for sensors, geolocation and multitouch makes life simpler for software developers. He emphasizes that the potential use of the WinRT APIs isn’t limited to sensor APIs, however. The scope, he says, also includes “other cool features of Windows 8 apps like contracts, background services, multitouch, multiple orientations and resolutions.”

Windows 8 for Ultrabook Devices and Beyond

As the installed base of Windows 8 devices grows, so does the opportunity for mobile developers to target a wide range of users and device types, including users of Windows 8 Ultrabook devices. In fact, Windows 8 makes it relatively fast and cost-effective to code once and run many -- meaning a big pool of potential customers.

“If [developers] build for the store, they have to recompile for each processor and put in flexibility for screen sizes, but they don’t have to recode,” says Rob Enderle, principal analyst at Enderle Group. “Assuming they follow the guidelines, it is a couple hours recompiling and testing for each platform, much of it automated. Much easier than with anything else. Developers love this platform.”  

Netflix was one of the first companies to offer a Windows 8 app. “We reuse a significant amount of C# code among our Windows 8, Windows Phone, Silverlight and Xbox apps,” says Joris Evers, corporate communications director. 

The ability to reuse code means developers can also leverage their existing skills for Windows 8 even though it provides a host of new features. “The tools offer Windows 7 developers familiar ramp-up to the platform, but Windows 8 offers HTML and Java Script developers [opportunities] to develop for the platform as well,” says Russ Whitman, Ratio Interactive’s chief strategy officer.

“These devs will be new to the tool set but will find there are a number of great online resources to ramp up on the tools,” Whitman continues. “They will find the platform supports their skill sets extremely well. We have turned several Web developers into Windows 8 app devs quickly.”

Windows 8 and Ultrabook: The Perfect Match?
On the Ultrabook platform, Windows 8 enables features and user experiences that are difficult or impossible for developers to create on Windows 7 Ultrabook devices. Enderle singles out four Windows 8 features that work particularly well with Ultrabook devices:

  • Fast boot, suspend and resume. That speed can increase productivity for mobile workers, says Enderle. “Improved load time is a big benefit we see,” agrees Whitman agrees. “It allows us to create highly complex experiences that are performant and offer users instant experiences.”
  • Wireless convenience. “[Windows 8] is both fast and easy to use with wireless networks, far easier than Windows 7 was, and this class of product is intended to be mobile,” Enderle says. 
  • Integration with Windows Store. “[Windows 8] uses the Windows App store by default, which, much like it is with a tablet, allows users to quickly get the applications they need for work or entertainment,” Enderle says. “Given these users by nature are more mobile, being able to get access to this stuff on the road is very compelling.”  
  • Integration with Microsoft’s SkyDrive. “SkyDrive links the user’s PCs, phones and tablets, allowing the user to switch devices quickly and still have access to their personal content, be it work, product or entertainment,” Enderle says. “This is a platform designed to optimize the highly mobile worker, and it dovetails nicely with the Ultrabook, a product class with similar design elements.” 

Windows 8 Ultrabook Devices: Additional Features
The UI options of Windows 8 are another draw. “The introduction of touch fundamentally creates opportunities to create more compelling user experiences,” Whitman says.

Speech control is another example of how the Ultrabook platform is enabling new ways for users to interact with their devices. This fall, some Ultrabook devices began shipping with Nuance’s Dragon Assistant Beta, which will run natively on the device. (By comparison, iPhone’s Siri uses the cloud.)

“With the recently announced Intel SDK, developers will have the ability to include speech recognition technology using Dragon’s API into applications for the Ultrabook,” says Mark Geremia, Nuance senior director for Dragon marketing. “We will have more to share on speech as it relates to Ultrabooks in the coming year.” [Disclosure: Intel is the sponsor of this content.]

That’s also another example of how developers can leverage their mobile expertise -- such as creating a great touch-driven GUI or speech-controlled app -- in the Ultrabook environment, where touch and speech input will be common. It’s a new world, but also a familiar one.

Developing your next app? Intel’s Perceptual Computing SDK brings new levels of usability and engagement to any app, with speech recognition, facial tracking, augmented reality and more. Get it today at www.intel.com/software/perceptual.

Photo: Wikimedia Commons