Image

In Search of One App for Many Targets

April 22, 2015
Microsoft’s Windows 10 will be the platform for Visual Studio 2015.

“To dream the impossible dream” when it comes to software is the concept of a universal programming language/environment/runtime that runs on any hardware. Of course, embedded developers know that attaining that goal is a lot harder than it looks. Just getting something to look good on two different-size displays is hard enough, let alone supporting multiple input devices, different power management schemes, a variety of connectivity mechanisms, and so on.

Oracle’s Java originally touted the “write once, run everywhere” ideal. Java has been successful running across a wide variety of platforms, but it is still a “write once, run almost everywhere, otherwise customize” solution. The Java virtual machine (JVM) made running the code on another platform easier, but it does not address details like user interface or device support.

Even C was designed to provide a level of portability, but system interfaces are the bane of developers. Frameworks like Qt (pronounced “cute”) provide a degree of display portability by providing the same API to developers while hiding the underlying operating system specifics. The graphics support allows an application to work on many different platforms, but there are challenges when providing controls to handle touch support because of differences in size and convention between platforms like PCs, tablets, and smartphones.

1. Microsoft’s Universal App framework allows developers to isolate target specific code for creating packages that incorporate this code with shared code for a deliverable.

I was reminded of this challenge while working with Microsoft’s Visual Studio 2015 and the company’s new Universal App framework (Fig. 1). The goal is to have an app in the Windows Store that would work across the Microsoft operating systems from phone to tablets to desktops. This is not the first time Microsoft has pushed portable application development. Its Common Language Infrastructure (CLI), C# and .NET provide portability similar to Java.

2. Creating a Universal App for targets with different capabilities requires customization. (Michael Crump, Telerik)

The Universal App framework builds on this and preserves common code within a project that is designed to be the bulk of an application with additional platform-specific code to address different platforms like smartphones and tablets (Fig. 2). Shared Projects within Visual Studio allow developers to create contextually appropriate user interfaces for the target platforms. This approach allows projects to target a platform while sharing code with other related projects.

Visual Studio targets Microsoft Windows platforms including the forthcoming Windows 10. By adding the Xamarin plugin, Visual Studio projects can target Android and iOS platforms as well. Xamarin maintains Mono, an open-source implementation of CLI that runs C# applications.

Using Visual Studio Tools for Apache Cordova is another way to enhance cross-platform support. Cordova supports Android, iOS 6, 7 and 8, Windows Phone 8.x and Windows 8.x. It is also designed to build native applications using HTML, CSS, and JavaScript.

Of course, Visual Studio can also package apps for the Windows Store and can upload the packages for multiple targets.

Designers still need to consider all targets and take into account their advantages and limitations. At least with Visual Studio 2015, the job is easier to manage. 

About the Author

William Wong Blog | Senior Content Director

Bill's latest articles are listed on this author page, William G. Wong

Bill Wong covers Digital, Embedded, Systems and Software topics at Electronic Design. He writes a number of columns, including Lab Bench and alt.embedded, plus Bill's Workbench hands-on column. Bill is a Georgia Tech alumni with a B.S in Electrical Engineering and a master's degree in computer science for Rutgers, The State University of New Jersey.

He has written a dozen books and was the first Director of PC Labs at PC Magazine. He has worked in the computer and publication industry for almost 40 years and has been with Electronic Design since 2000. He helps run the Mercer Science and Engineering Fair in Mercer County, NJ.

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!