When Microsoft recently released the latest version of Windows Phone, third party developers for the platform jumped in the air like they were in a bad ad for geeky fitness centers.
A plethora of functionality has been updated and added to the platform, a lot of it offers developers new opportunities to integrate, expand, improve and add value to their work.
There are many new goodies, but I want to cover the most exciting ones here. We will cover documented and rumored features, sprinkled with some wishful thinking.
Personal Digital Assistants (PDA) are here to make your life easier and to help you not only stay organized but to enrich your mobile experience. Most users have heard of Siri or Google Now, which are the PDAs from Apple and Google.
Now meet Cortana, Microsoft’s version of a PDA for your phone.
Siri is great at opening apps, setting up appointments and telling you about the weather. Google Now does well with recognizing music, getting directions and finding nearby restaurants. Cortana does all of these.
As Cortana is still a beta product, there are areas where she is not as well versed as the two competitors. However, “her” (as Microsoft consistently refers to Cortana) approach is to be more personalized by keeping a notebook about you, the user.
This notebook allows her to know about your favorite locations, such as home and work. When it is time to go home she will automatically tell you how long it will take based on traffic conditions.
Besides joke answers to specific questions (try “who’s your daddy”), Cortana has two major things advantages in my opinion.
The first is understanding context. Allow me to demonstrate:
Me: What are the best Japanese restaurants around here?
Cortana: I found these 10 Japanese restaurants in your area
Me: Show me how to get to the second one.
Cortana: Here are the directions for insert restaurant name
Me: How long does it take to walk there?
Cortana: It takes 12 minutes to walk to insert restaurant name
This is a huge step forward as it allows you to refine your question or instruction, without having to start over again. This also works with weather (“show me in Celsius” or “what is it like on Tuesday”).
The second major advantage is that Cortana is designed to understand natural language. Cortana will teach itself over time the more it is used, not just by you, but by everyone. There are still limitations, but you can use normal phrasing to set up appointments, get directions and contact people.
Learn PHP for free!
Make the leap into server-side programming with a comprehensive cover of PHP & MySQL.
RRP $11.95 Yours absolutely free
This makes Cortana much less frustrating to use compared to Siri, where there is a learning curve to get Apple’s PDA to do what you want. This will only improve over time.
What does all this mean for developers? For now not much, as the API for Cortana hasn’t been released officially to the general development community. But there is massive potential to allow third party apps to integrate with Cortana and enrich the experience no end.
Imagine you could say “Cortana, tweet the link in Internet Explorer and say ‘Cool new Windows Phone features’”. Or you could have your personal FitBit statistics know by Cortana, so she can prompt you to walk instead of taking the train if you are behind on your daily target of so many steps. The possibilities are endless.
Unconfirmed sources say that the API will be released with the public release of Cortana, hopefully by the end of June. I personally think it will take longer, as it is a tricky thing to get right.
You may have noticed that a number of products and services from Microsoft have lately been re-named “One”. For example there is OneDrive and Xbox One. This is to align with Microsoft long term goal of “One platform”, and “one experience”.
This means that your apps will work across phone, tablet, desktop and Xbox, with a common data repository on OneDrive. No other ecosystem can offer this, and it will be a valuable differentiator for Microsoft in the years to come.
In that vein Windows Phone 8.1 offers a new project type of Universal App, which means that you write your code once (almost) and your app will run on both Windows Phone and Windows. Windows Phone 8.1 can now run the Windows Runtime, also known as Windows RT.
The approach is great and makes sense in the great scheme of things. But as a developer on the ground having to develop for Windows Phone 8.1, it does confuse things. Not only are there now two approaches to develop for Windows Phone, but there doesn’t seem to be any official naming for the “new” way. I have heard it referred to as :
- Universal Apps
- Xaml Apps
- AppX apps
- Windows RT Apps
- Windows Phone Store Apps
And there are probably more. That is not helpful. For this article I will stick with Universal Apps. Done.
To make it even worse, the “old” way of developing apps is now referred to as “Silverlight Apps”. Here was I thinking that the Silverlight name had gone into retirement in a nice sunny spot in Florida.
It is almost as if Microsoft is saying “we’ll give the old gal one more go, before she is put down for good”.
Having said that, Microsoft has put a lot of emphasis into saying that all your Windows Phone 8.0 apps are still good to go, and 8.1 will run them all. Furthermore, Microsoft will continue to invest in the Silverlight (get used to the name) app framework.
“When should you choose one over the other?” I hear you ask.
If you have an existing Windows Phone 8.0 app and want to upgrade, then stick to Silverlight. It is just too messy to convert to a Universal app.
However, if you have background audio, or you are using the GPS background task in your 8.0 app, then don’t upgrade, because it doesn’t work in 8.1. Yep, that’s right. Stuff is broken already.
Building a brand new app? My advice is to start a Universal app from the start. You not only get access to the 20 million Windows Phone users, but also the 220 odd million Windows users in one fell swoop.
You get all of the new APIs, such as 40 notification and live tile templates instead of 5 or 6. You get responsive controls that use the same code, but behave differently depending on platform.
There are a few things you can’t do with Universal apps, but it really isn’t a deal breaker unless you want to use functionality such as reminders, clipboard or create a lock screen provider.
Although a number of APIs are missing from Universal apps, my bet is they will come back reasonably soon as the platform expands. I have no doubt that Microsoft is in this for the long haul.
Notifications are a main feature on any smartphone. You want to know if someone sent you a text, if you received a tweet, who called you and so on. Although you received all these notifications in Windows Phone 8.0, there was nowhere to see them all and often notifications were lost.
That 15 minute auction ending message in the eBay app only worked if you were looking at your phone at that instant. In Windows Phone 8.1, notifications have a new home in the Action Center. Notifications for each app are stored in the Action Center, if the user allows it. All can be configured from the settings menu.
As a developer you can choose how your apps are integrated, and you can integrate fully with the Action Center. You can now choose to have “ghost” notifications, which means the user is never alerted. Instead the notification goes straight to the action center. This is used by the new Store app to notify users of how many apps were automatically updated (yes, apps are finally automatically updated).
Developers can now finally rely on notifications for critical messages to the user, and Universal Apps (see above) also use the much more reliable Windows Notification Service for delivering notifications.
With my background in mapping, routing and logistics I really enjoy maps and everything that comes with them. A feature that has received little attention in the talks of Windows Phone 8.1 is the geo-location functionality.
In your app you can set up to 1000 geographical points that your app can respond to. If you are building an app to track favorite coffee shops, the user can mark locations in the app, and when they next walk by your app will trigger an event.
You can do whatever you want with the app when handling the event, for example tell the user that they are near excellent coffee, imagine if retailers got on board too. Their specials could be served to your users in real time.
“Did you know that Sam’s Coffee Bar has a special on the new Geisha beans this week?”, or something like that.
Or hook your app up to the car’s OBD connector via the new Bluetooth LE protocol, and when your app detects the car is running low on fuel you can alert the user and guide them to the nearest petrol station based on their preferences.
Application Life Cycle Management
The life cycle between Silverlight apps and Universal apps are vastly different. Universal apps follows Windows Apps and their life cycle.
The main difference is that all apps are always suspended instead of closed. If the user presses the Back button in the first page of the app, it won’t be closed (as in Windows Phone 8.0) anymore, but just suspended. Just like if the user has pressed the Start button.
For developers this means your app is always opened the same way, regardless of entry point, unless of course the user explicitly closes the app in the task switcher.
Another important point that goes hand in hand with the app lifecycle is the navigation framework, and in particular the back button. It doesn’t automatically redirect the user to the previous page of the app, but to the previous app in the operating system’s stack.
If you want to keep the navigation approach from Windows Phone 8.0 you need to intercept the Back button event and redirect the user to the previous page manually. But the best part for developers is the new Frame class that has replaced the NavigationService.
Where you could only pass string parameters before, the Frame class allows complex objects to be passed between pages. A lot of devs have been waiting for this.
The Future is Bright
There are a ton more features both for consumers and developers in Windows Phone 8.1. There is a lot more to come, and this article only gave a taste of some of the best bits that I find the most exciting.
Windows Phone is not going away, despite not performing particularly well in some markets, especially the more established ones.
In Europe, Asia and South America, Windows Phone is gaining. In some markets the platform has even surpassed iPhone.
Reading this you might be using an Android or iPhone, and that is fine. But I dare you to spend some time with Windows Phone 8.1 and give it a chance. It might just win you over.
Lars is a freelance solution architect, Pluralsight Author, Microsoft MVP, writer and podcast host with a passion for the Microsoft ecosystem. Lars is co-founder of the DDD Melbourne community event with over 350 participants, now in its seventh year running and has presented at various technical events nationally and internationally.
Jump Start Git, 2nd Edition
Visual Studio Code: End-to-End Editing and Debugging Tools for Web Developers