:::: MENU ::::

Building Universal Apps for Windows Phone

This article was first posted on blog.dvlup.com

At Microsoft’s annual conference //build/ recently, a lot of really cool stuff was announced across the entire product suite for developers. As a recently knighted Microsoft Windows Phone Developer MVP I had a particular interest in the announcement of Windows Phone 8.1.

As many awesome features as there are coming in this massive update for the greatest smartphone platform (yes, I am a little biased ;)), I wanted to make mention of one in particular: Universal apps.

Universal Apps Logo

What is it?

In a nutshell, this means Windows Runtime apps can now run on Windows Phone. You can still build, run and publish traditional Silverlight apps as well, and there is a swathe of new features for that as well. But on top, the World’s most personable smartphone can now run your Windows 8 apps as well.

For some time there has been rumours and some action about cross platform development and apps. This is the first step towards true multi-platform targeted apps that has come out of Redmond. Days of trying to build apps that target several platforms by using portable class libraries and then several projects for your views and frontend are now gone. Well sort of at least.

In the future, your Universal apps will also run on Xbox One. This will be another step towards truly ubiquitous apps.

What Can I do?

You now have a large number of common APIs that works across devices with the same code. This goes for toast notifications, background processing, live tile management, menu items and much more. You can build a single project that is then able to run on multiple targets.

The XAML components will either adapt their layout to the different form factors, or they will be a different implementation for each. As a developer though, you just use the one control. Easy.

What Can’t I do?

There are certain APIs that aren’t available when build Universal apps. These include using alarms and reminders, integrating your app as a Lens (for integrating with the camera), use the GPS background process and use the camera chooser task.

There is a distinction between the two approaches, and you need to understand what you can and can’t do before choosing one app type over another.

What Does It Mean for You?

This is the coolest part. You can now build one app that runs on phone, phablet, tablet, desktop and everything in between. You can truly build something awesome once that works across platforms and makes a much better return on investment. You can sell the same app on both phone and desktop with no extra work. This makes cross platform work a breeze.

Which Framework Should I Choose?

I don’t blame you, if you are slightly confused by now. There are now two frameworks to choose from, when developing Windows Phone apps. Should you choose traditional Silverlight apps, or use the new Universal Apps?

If you are already building an app, the easiest is to keep using the Silverlight framework. You avoid any rewrite this way and you can use all of the new 8.1 features without rework.

If you are building a brand new app, I would recommend using the Universal app, unless a specific feature only available on Silverlight apps is needed. I believe Universal apps are the way of the future for most apps, especially if you are building a relatively simple project that isn’t relying on specific phone features.

How do I get started?

To get you on your way with Universal apps, you need to download the latest version of Visual Studio, which is available here.

Then start your first Universal app project by following the MSDN documentation. Happy coding and enjoy being twice as productive.

Universal Apps Tools