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.”

Mobile Device Adoption: Targeting the Next 50 Percent

Fifty-five percent of American mobile users now own a smartphone. That’s about 130 million people, which is a big pool of potential customers for your app. But what if that addressable market doubled?

It won’t happen easily or soon. The low-hanging fruit -- techies, prosumers, business people -- has been picked. Meanwhile, T-Mobile USA is among the mobile operators scrapping the tradition of handset subsidies. If that becomes a trend, then feature phone owners who want to upgrade tomorrow will have to shell out at least twice the amount they would today.

“One way or another, you’re going to have to pay some significant cost at some point, whether it’s up front -- $500 or $600 for the smartphone -- or $200 up front and $20 every month,” says Ramon Llamas, IDC research manager.

That’s one barrier. Another is the cost of a data plan, although that’s becoming less of a hurdle thanks to the growing selection of cut-rate, unlimited-data plans, such as those from Straight Talk and T-Mobile. The roll-out of Long-Term Evolution (LTE) could enable even more aggressive pricing strategies because the technology significantly lowers an operator’s cost of delivering data service.

“Carriers are interested in smartphone growth since they can compensate drops in voice and SMS revenue with data flat rates,” says Brent McMicking, who manages Intel’s phone launches worldwide. [Disclosure: Intel is the sponsor of this content.]

Who’s Using -- and Not Using -- Smartphones
The analyst firm iGR recently asked over 1,000 U.S. consumers about their plans to buy a phone in the next 30 days.

“The majority of those who were likely to buy [a phone] say they would probably buy a smartphone,” says Matthew Vartabedian, iGR vice president. “Not surprising. What I did find interesting was that older respondents (35+) with feature phones were about 10 to 20 percent more likely to buy a smartphone than younger respondents. Younger respondents (18-34) were more likely to buy multiple smartphones (two or more), which is also interesting. The survey data suggests that older consumers are already choosing smartphones.”

The catch is that not every first-time smartphone owner uses many -- or any -- apps. “[After] six months, my father-in-law has yet to use his iPhone 4 for anything except voice and text,” Vartabedian says. “He uses the preloaded weather and stock apps, but that's it. Maybe some Web browsing. I think he generates about 20 MB of 3G data in a month. I don't think he's even opened the App Store.” 

Smartphones Take Off in Developing Markets
There are a couple of reasons why it’s worth looking at smartphone adoption outside of the U.S. The first is that there are big potential markets, at least for those developers willing to localize their apps, such as in terms of language.

The second is because the strategies that vendors are using to upsell foreign consumers could be applied in the U.S., too. One example is the Yolo smartphone, which Intel and Safaricom recently launched in Kenya. It’s noteworthy because it’s the first smartphone to feature a processor and reference design created to reduce manufacturing costs without cutting corners such as performance. For example, the Yolo smartphone has 1.2 GHz processor, a 5 megapixel camera and support for 21 Mbps HSPA+ service.

That feature set is a break from tradition: In both developed and developing markets, affordable has been synonymous with pokey processors, limited memory and other shortcomings. Those undermine the app user experience.

“In India, Indonesia and China, they’re cutting corners left and right,” Llamas says. The device build [quality] is rather cheap, so people are replacing their phones every six to eight months.”

The Yolo smartphone sold out within two weeks of its debut. That suggests that a lot of people in developing countries who don't own a smartphone already understand the benefits of owning one, such as the selection of apps. Translation: There’s pent-up demand not only for smartphones, but also for apps.

“In emerging markets, smartphones will be the first computer device for many people and provide a deeper Internet experience versus feature phones,” McMicking says. “Pent-up demand for smartphones is a function of perceived value and the overall experience, of which apps are a part. The opportunity for developers is to reach a new set of customers.”

Playing the Long and Short Game with HTML5: Part 2

As the buzz around HTML5 keeps growing, we look at the technologies future and potential. Check out part one here.  

Breaking Free
One advantage of a true cross-platform technology like HTML5 is that developers no longer need to rely on native technologies to deploy their apps on specific hardware platforms. That means being able to potentially circumvent app stores that demand costly native development and take a portion of the profits. The downside is that often the support of these proprietary app stores can make the difference between sinking without a trace and being the featured app of the month and reaching an audience of millions.

For developers that perhaps have less need for the support that app stores can offer, HTML5 offers a significant advantage over native development, particularly when combined with native code whenever it makes sense.

“Many popular Web 2.0 services are using a technology like PhoneGap or a custom native wrapper that allows you to build the user interface for an application in HTML5 and use native code where necessary to deploy the same server-based user interface across mobile and desktop applications,” says Gail Frederick, product planning manager for Intel’s Open Source Technology Center. “And being able to update the UI without needing an app store update is a big advantage for them.” [Disclosure: Intel is the sponsor of this content.].

Selecting the parts that HTML5 can already do well and combining those with native technologies to do the things they want to do is proving to be an effective interim solution for many developers. “I think today that’s a very common programming model,” says Frederick.

“If we talk about Chrome being the bleeding edge and the idea that looking into the Chrome store is looking into the future, as we’re looking into that future, a lot of developers are going the hybrid route today as a hedge against the parts of HTML5 where the syntax might be settled but the performance needs work.”

Prying Eyes
Another serious concern with HTML5 for some developers (when compared to native programming) is the transparency of the source code for the application. Even the most basic computer user can easily display the code that powers the web pages being viewed, all of which can be instantly copied with a quick View Source and CTRL+C. Being essentially a web language that runs in browsers, HTML5 suffers from the same surfeit of accessibility, and hence, apps created using the platform are exposed.

Cloning is the widespread and illegal act of copying code and publishing a practically identical app, often only weeks or even as little as a few days after the original is released. The practice is a particular concern in gaming circles, where success increasingly depends on maximizing revenue through micro-transactions, and where certain large global markets suffer from the twin curses of inaccessibility and a somewhat loose application of copyright law.

All is not lost however. “If you were to do a View Source on most of these jQuery mobile apps you’ll find that a lot of the proprietary business logic is in the cloud, and that’s how people deal with it,” says Mike Richmond, from Intel’s Open Source Technology Center.

The team at European social gaming startup oOki is very aware of the issues presented by the transparency of HTML5. “Theoretically, all the game code can be read or copied, which poses problems in terms of cheating, piracy and cloning,” says Stephane Caillet, head of game programming at oOki. “It’s always possible to make it less readable by obfuscating the code, but parts will always be readable to a programmer.”

The cloud-based solution observed by Richmond is also oOki’s preferred approach. “The most effective solution is to manage a large part of the code server side,” says Caillet. “That code will never be downloaded by the client. In our case, for example, the game rules are handled by the server to avoid any cheating. We also encrypt all the network communications.”

The Long Game
What’s clear is that HTML5 is here to stay and it will change the face of application development. Whether it reaches its full potential next month or two years from now, its evolution is continuing apace, bringing new capabilities and new kinds of developers into its sphere of influence. Intel continues to show a keen interest in optimizing the platform for its hardware, as both the power of available hardware and of the platform continue to grow.

“We’re seeing some very interesting stuff happen on the PC with HTML5,” says Richmond. “If you browse the Chrome store you can see what this programming platform can do when you actually have a powerful processor. It really points to the future, because Moore’s Law says that what you have on the high-end devices will become a commodity two or three years later.”

“The position we’re taking is that HTML5 is a long-term friend,” continues Richmond. “This isn’t an instant changeover, so don’t throw out your C programming book if you’re a C programmer. At the same time, the technology is ready today for doing a number of things that would really be a waste to do with native code.

“If you’re a professional developer and have a broader range of language skills you should just add this to your toolbox and use it because it will save time and money. And if you’re a content developer you should be trying your hand at developing apps, knowing that as you get more experienced the capabilities you need for doing more advanced things are going to improve all the time.”

“There’s always a technology hype cycle that happens, and HTML5 has probably gone past the peak hype stage and is now in the ‘is this really going to happen?’ phase,” says Richmond. “But it is happening. The economics are just too compelling.”

Sound Strategy: Leveraging Mobile Speech Recognition

The arrival of Apple’s Siri personal assistant on iPhone 4S last year raised the profile of speech recognition on mobile devices. And now, the technology is poised to become even more widely embedded.

                                                         

Siri’s speech capabilities let users employ voice commands to handle tasks such as sending messages, initiating calls and setting up meetings. While Siri bakes speech recognition into the phone and its core functions, more recent industry moves let developers tap the technology.

To wit: In August, Nuance Communications launched Nina, a virtual assistant that adds speech capabilities to iOS and Android apps. Nina -- which includes voice biometrics in addition to speech recognition -- offers an open SDK to enable developers to integrate those capabilities into their mobile apps. Nuance also offers Dragon Mobile SDK, which lets app developers voice-enable iOS (4.0 and higher), Android (2.1 and higher) and Windows Phone (7.5 at press time) apps. In November, Nuance stated that more than 13,000 developers had utilized the SDK. 

In another vote for voice, Intel’s Perceptual Computing SDK 2013 Beta, released in October as a free download, lets developers add speech recognition to apps along with other features such as 2D/3D object tracking. The SDK is geared toward apps running on second and third generation Intel Core processor-based Ultrabooks and PCs. [Disclosure: Intel is the sponsor of this content.] 

Third-party moves such as these complement those of the platform makers: Apple’s previously mentioned Siri and Google’s Android SDK, which lets developers integrate speech.

The Growth of Speech Recognition in Mobile Apps
Overall, the stage has been set for the expansion of speech recognition on mobile devices. Chris Silva, mobile analyst at Altimeter Group, a research and advisory firm, credits Apple and Google for setting the current pace. Apple, he says, sweetened the pot with Siri, noting that Google also provides voice recognition capabilities for native phone functions.

“Apple and Google are the major forces that are not just advancing voice recognition technology, but advancing voice as a means to interact with our phones, PCs and tablets,” Silva says.

Microsoft has also had a strong role in voice technology, Silva notes, citing the company’s effort to unify Windows Phone and its Xbox gaming console as an example. The company provides an app that turns a phone into a voice-enabled remote control for browsing media content on an Xbox.

Spurring Speech Recognition Development
App developers will be the ones to broaden the scope of voice-enabled mobile apps beyond a phone’s basic capabilities. But they may need more than SDKs to do so.

Adding speech recognition to apps remains a complex task once developers get outside of the typical set of commands understood by devices, Silva says. He expects to see libraries of voice commands and actions as well as voice-centric middleware that will help developers take advantage of the technology.

Silva suggests that the evolution of push notifications on mobile platforms parallels voice recognition. Most developers didn’t pursue push notification capabilities right away when they became available for iOS and Android.  However, Urban Airship stepped into that particular gap, enabling developers to build push messaging for iOS, Blackberry or Android devices via an API.

“It took Airship to provide a set of libraries and tools to harness the new interaction methods and the same thing will happen with voice,” Silva says.

The Current Mobile Speech Recognition Landscape
That said, companies are beginning to bring speech recognition capabilities to more and more mobile apps. Ask.com, for instance, integrates Nuance’s speech recognition technology into its iOS and Android apps. This linkage lets users “use their voice to ask and answer questions as well as comment on answers,” says Erik Collier, vice president of product at Ask.com.

Specifically, Ask.com uses Nuance’s Dragon Mobile SDK for iOS. For Android, the company uses the built-in functions provided in the Android SDK. Collier says both Nuance and Android integrations are straightforward, noting the company hasn’t faced any issues implementing them. “We’ve seen good traction with our users leveraging the voice recognition feature and we’ll continue to monitor for signals of further enhancements.”

Indeed, this nascent technology sector will keep industry executives and market analysts anticipating developments. For Silva, the future involves an unfolding of events that will eventually lead to what he terms the “sentient world.”

Silva sees this progression beginning with a wider support for voice across handsets and tablets, continuing with the rise of voice recognition tools and middleware for developers, and, finally, moving to the emergence of autonomous interaction between users and devices. In the latter phase, he says, sensors on mobile platforms will sample the air for context and automatically present users with information.

“It will take a while to get there, but I think voice is one of the first dominos to fall in a journey to a much more natural interaction with our technology,” Silva says.

Playing the Long and Short Game with HTML5: Part 1

Emotions have been running high in the HTML5 application development space in recent months. With the current worldwide explosion of mobile and web app use currently underway, many feel HMTL5 is the bright future of cross-platform development.

The vision is simple: one single, straightforward web programming language that allows the creation of anything from a basic service app to a complex game that works across any platform without the need for native development. In theory, HTML5 is a developer’s dream, reducing costs, leveling the playing field and, for app and game studios in particular, opening the floodgates to a wealth of new potential development talent. But in practice, as is often the case when disruptive new technologies enter the marketplace, the road ahead for HTML5 has some twists and turns.

One of the hottest HTML5 debates centers around game development. Games are complex beasts that generally require specialized coding and the creation of native versions for each platform they are deployed on. The idea that HTML5 could eliminate these hurdles is exciting to the countless coders around the world who are working to embrace the emerging technology.

But after initial exploratory efforts across the breadth of the cross-platform game development community, many reluctantly admit that HTML5 remains a promise for the future, not a current reality. In an article published on GamesIndustry International in May, two developers from GameDuell aimed a pin at the bubble of excitement surrounding HTML5 and, while investment in HTML5 game development is certainly continuing, the resulting burst bubble gives pause for thought.

It may be true that the platform is not yet ready to deliver Call of Duty on a phone, but many developers are investing heavily and successfully in HTML5 right now, predominantly in the app space, but also in games. At Google’s I/O conference in June, Electronic Arts unveiled a working prototype of a social cross-platform action game entitled Strike Fortress, designed to showcase exactly what HTML5 is -- or at least soon will be -- capable of. Although that game is not planned for release, it demonstrates that for developers with the right skill-set and approach, HTML5 is already working -- and working well.

An App for That
For a look at fully functional HTML5 apps that are already making the cross-platform dream a concrete reality, try visiting the www.jqmgallery.com website. The site is a showcase of 150 jQuery mobile applications submitted by developers and the companies the apps were built for. “There’s a huge spectrum of major companies represented there doing relatively straightforward but useful apps, and they run,” says Mike Richmond, from Intel’s Open Source Technology Center. [Disclosure: Intel is the sponsor of this content.]

They’re apps designed for mobile, but the fact that they’ve been created using HTML5 means they will essentially run on any platform, with no native development required. “You can point your Chrome browser to any that are actually live in the site and run them,” says Richmond. “Most are designed as mobile apps so they are not designed to exploit a big screen, but they work.”

Playtime
The question of game development in HTML5 is a good deal more complex. The games industry is currently taking a moderate perspective on the usefulness of HTML5. “There are clearly games that can’t be done cross-platform with HTML5 right now,” says Richmond, “but there’s a tremendous amount of industry attention on this problem.”

“Whether you’re talking about the work that’s being done by us and Tizen, or the work that Google is doing in Chrome and Chrome OS, we’re all very keenly aware of the problems that are yet to be solved,” says Richmond.

Limitations with HTML5 can manifest themselves as a result of the sheer scale involved when developing games as opposed to more straightforward applications. Problems can range from a lack of clarity with script organization and issues with certain browsers, to programmers’ potentially reduced mastery of code behaviors resulting from the language’s high tolerance for less than optimum coding.

“I don’t think we’re there yet, at least not for every kind of app,” says Richmond. “For the kind of apps on the jQuery mobile gallery the answer is, yes we are there. For games, if you want to write a first-person shooter, that’s probably not true.”

Ultimately, the limitations developers hit with HTML5 will depend on the type of application they’re creating. European social gaming startup oOki is currently developing its first online multiplayer puzzle game for deployment on Facebook followed by other platforms, including browsers and mobile. The company decided early on to embrace HTML5 standards, seeing it very much as the future of cross-platform social game development, and the team is confident that it made the right decision.

“Some parts of HTML5 still need work, like WebGL management, and there are still a few problems with certain browsers, but the remaining hurdles can easily be overcome,” says Stephane Caillet, head of game programming at oOki. “We haven’t hit any problems we couldn’t find a way around.”

Caillet has a rather more well-defined goal when it comes to the real or perceived limitations of HTML5: “For me, the main challenge with HTML5 is showing that you can make better applications than you can with Flash.”

Speed Freaks
Another accusation regularly aimed at HTML5 is that it lacks speed when compared to, for example, C or other native programming languages. However, the speed issue is often not as clear cut as some of the naysayers would have us believe, and can be seen to have emerged more as a result of the migration of programmers from other languages to HTML5 and its related languages such as JavaScript and CSS rather than because of any intrinsic weakness in the platform itself.

“The straight programming comparisons between C and JavaScript are potentially quite misleading,” says Richmond. “First of all, JavaScript performance has probably improved by a factor of 50 to 100 in the last five years on exactly the same hardware based on the introduction of just-in-time compiler technology.”

Richmond paints a colorful picture to illustrate his point: “One of the things we’ve noticed is that if you ask a C programmer to program in JavaScript, a really good C programmer can become competent in JavaScript in about six weeks,” said Richmond. “Then if you tell the programmer to create dancing birds flying across the screen, they’ll start coding in JavaScript the same way they would have coded in C.

“Then the programmer will benchmark the code and say, ‘Oh look, it’s slower in JavaScript than it would be if I had written it in C,’” continues Richmond. “But then a content author comes along and says, ‘You want dancing birds? Well I’ll do that in five lines of HTML and forty lines of CSS, and that’ll run faster than either of them.’ Why? Because the CSS code was implemented by the best programmers on the planet working on the browser. This is particularly relevant for people doing visual-oriented apps. There’s a set of things you can do in CSS that, unless you’re trained as a content author, you might not even consider.

“And it’s very controversial,” continues Richmond. “If you go to a web developer convention and throw the word CSS out there, you’ll hear pros and cons. But the implementation of CSS is tied to the heart of the browser and the heart of the graphic subsystem, and if what you want to do is possible with CSS it’s going to be very, very fast.”

Caillet has certainly encountered no issues in terms of speed compared to the previous industry standard development platform for online social games: “For our game we’re achieving a level of performance that’s at least as good as a comparable Flash game.”

This reality is part of the opportunity Richmond sees for content authors to become highly successful app developers and grow the overall development ecosystem. “We see HTML5 bringing a whole new set of application developers to computing, and the people that it brings start out as content authors. Normally you associate people who do content development and authoring with creating websites. They have a certain kind of training and a certain set of sensibilities and skills, and then suddenly those people are creating applications.

“Compared to the traditional software engineering model where you go and get a computer science degree, learn to code in C, and use a certain set of tools, it’s all different now for these other people,” concludes Richmond.

Photo: Corbis Images