What's New in Mango?

symbiatch - 26.05.2011 15.59 - mobiili ohjelmointi 


Mango supports a gyroscope, but it is optional. The reason for this is that all current phones will support Mango, but they don't have gyros. All new devices should have a gyro. Also support for another SoC was added. Otherwise the requirements are the same as they were for 7.0

In the API front there are new HW APIs: access to camera, motion sensor, compass and gyro.

The camera can be accessed via two APIs: PhotoCamera API supports HQ photos, flash/focus modes etc. Webcam API allows recording video and audio. The former works with a pull model and the latter with a push model.

Compass is available on some pre-Mango phones, but not all. It works if it works, like usual. With my iPhone and Google Maps I usually get an error that's like 30 degrees. So it's useless. I probably should use it only in some deep forest?

Motion Sensor is a virtual sensor that combines gyro, compass and accelerometer. It's more accurate, faster in response and has low drift. it can also disambiguate motion types and has fall-back if there is no gyro in the device. Microsoft recommends using Motion Sensor when available. If you don't have a compass, the API does not work and you should use accelerometer directly.

The OS checks if calibration is needed, the application should show a UI for it. There is a reference implementation that can be copy&pasted directly.


Mango runs Silverlight 4. No breaking changes for apps that work with 7.0. Implicit styles, RichTextBox, ViewBox, more touch events (tap, double tap). If you recompile the app for Mango, there are some changes that have to be taken into account, like WebClient (returns in the thread it was called in, not in UI thread) and background running.

Sockets, Clipboard, IME, IE9 Browser, VideoBrush.

Performance: Gen GC means much faster garbage collecting and less lag, Input Thread means better touch input since it's different from the UI thread, Working set, Profiler tool is available with the SDK. Don't profile the emulator, it's naturally useless. And you can't profile 7.0 apps.

Sockets support TCP, UDP with uni/multicast on wifi. Connection manager control overrides and/or sets preferences e.g. if you always need to communicate through wifi. WebClient allows full HTTP header access and returns in the originating thread and not the UI thread.

XNA inside Silverlight App. Integration at the page level, XNA takes over the rendering. Integration at element level, Silverlight elements in XNA pipeline via UIElementRenderer. Input is shared. So now you can do XNA-3D in your Silverlight app or do your XNA game UIs with Silverlight.

Local database! SQL Compact Edition. LINQ to SQL to query, filter, sort. Object model for CRUD. Application level access, so it's sandboxed from other applications. Background agents can access the database. And there's a DatabaseSchemaUpdater APIs for upgrades since there is no direct SQL access.

Application Model

Fast Application Resume. Apps are not thrown out of memory immediately, at most five apps are held in memory and only "tombstoned" if memory is low etc. So now switching apps is faster. And old apps will continue working, no problem.

Multi-tasking is available, but Microsoft wants to make sure the power usage is minimal and user experience is good. This is why there is no "real" multi-tasking.

The options are: bg transfer service, bg audio, bg agents (periodic and on idle), alarms and reminders.

Using BG audio you have to start playing the sound from a foreground application. A bg app cannot start play but can continue playing. Application will be shut down, but a separate agent will continue running and provide the sound and handle next/prev etc.

BG audio app types: URL PlayList and Stream Source. Former just tells which URLs to play, the latter will provide audio buffers and can have custom decryption/decompression.

BG agents are periodic or on idle. They are initialized in foreground but run on background. They persist across reboots! User controls through control panel and there can be at maximum 18 running periodic agents. Agent runs for up to 14 days but it can be renewed. This is just because if you don't run the application in two weeks, you probably won't even be using it. You can set a smaller run time limit if you want to. The timer is reset every time the app is run.

Periodic agent runs around every 30 minutes and they get around 15 seconds of time. It must have less than 6MB of memory and less than 10% CPU (limits subject to change before RTM).

On Idle agents run when on external power and non-cell network. They can run for 10 minutes and can use more CPU but less than 6MB of memory.

BG agent functionality allowed: tiles, toast, location, network, R/W isolated storage, sockets, most framework APIs.

BG agent functionality disallowed: display UI, XNA, microphone, camera, sensors, play audio (only BG audio APIs).

Agents continue running until the agent itself aborts it, the time limit (default 14 days) is met or the user removes it via the control panel. If you try to add a bg agent and there are already 18 running, there is an exception. The user must remove some agent to allow your app to create one.

One application can have only one idle agent, one bg agent and one bg audio handler. The agents can run whatever tasks they like, but there can only be one of each.


Time-based on-phone notifications. Supports alerts and reminders, persist across reboots and adheres to user settings. Alarms are modal, snooze/dismiss, sound customization, no app invocation, no stacking. Reminders have rich information, integrate with other reminders, snooze/dismiss, launches app if clicked.

Background Transfer Service

Start transfer in foreground, complete in background, even if app is closed. Queue persists across reboots and has a limit of 5. Single service for all applications, FIFO. Upload limit around 4MB, downloading more than 20MB only when using wifi. The files are transferred to isolated storage. The 5 file limit is per application, so other apps can download even if your app has its queue full. The FIFO system is global.


Local tile APIs have full control of ALL properties. You can update the tile information from your app or background agent and don't have to use push notifications etc.

You can also create multiple tiles per application. The tiles can deep link, which means you can add parameters to the tiles so that they start the application in some other place than the front page.

Push Notification

No API changes, but lots of enhancemens on the reliability, efficiency and performance. Better radio usage, faster state machine, smarter queuing etc. Nothing for the developer itself.

The user can have 30 applications using push notifications at one time now, previously the limit was 15.


This is one of the great things. You can integrate Bing Search results with your app. There are four item types: movies, places, events and products. The search will show a card for the item and any application can register itself as being able to handle this information. You can e.g. tell the system that you can handle movies and the user can start your application to e.g. buy the movie online directly from the search results.

You can read contacts and calendar entries, but you can't write data. You can start a launcher that saves data, but that requires user interaction.

What Now?

7.0 apps will run nicely with Mango. But if you really want to get the nice features, target Mango already and be ready. Especially the fast task switching is nice for any application.


Windows Phone Develioer Day 2011

symbiatch - 26.05.2011 08.59 - mobiili ohjelmointi 

Today I'm attending Microsoft's Windows Phone Developer Day in Helsinki. Should be interesting, I haven't done much WP development. And it's nice to see something about the Mango. Naturally the Mango part is the last so that people won't just come to see that and leave. But who would do that anyway...

650 people were allowed to attend and they're saying it's going to be packed. There are already lots of people here, more still pouring in...

Keynote speaker is Brandon Watson, the rest of the day is hosted by Jaime Rodriquez. Sessions include Designing for Windows Phone, Introduction to Silverlight and Tools, Application Development for Windows Phone, Integrating with Windows Phone Hardware and the Services, What's new in Mango.

Brandon's Keynote

I'll write stuff about Brandon's keynote here, other sessions are probably handled in other posts if there's interesting stuff to talk about.

He says that this is the first WP Dev conf after the announcement of Mango. So they really seem to care about Finland ;)

In 7 months Microsoft has gotten 1.6 million tools downloads, 18k apps in WP7 Marketplace, 42k registered developers... Not bad, really.

Oh, and people can really stop complaining: multitasking, raw camera access, socket access etc are in Mango. So don't worry. Also Brandon said that apps can continue to work in the background. So maybe the multitasking will be more than just saving the app state, as it mostly is in iPhone.

Bing and Things

Nice! If you search for example a movie, you'll get a product card with information about the movie. You can find information, schedules etc. But the most interesting thing is App Connect. There is a pane where you have direct links to applications that have informed the phone that they can handle e.g. movie cards. The user has a direct link to the application. Not seen anywhere else, guys.

Oh, what about if your app can handle it but is not installed? No worries, it is still shown in the list! So people can install your app directly from search if it looks like an interesting app for e.g. movies. This is cool!


There is also a beta distribution option, 100 users, app has to be free, no update etc. Private distribution serves also paid apps, but the app is not publicly visible in the marketplace. And then there's the public marketplace. This is also a very good enhancement.

App Hub

New dashboard, W-8 forms, clear notifications etc. If your app is rejected, you get a clear PDF report stating what the problems were. This is one thing that could be a lot better than Apple's. I've gotten stupid short messages from them and twice they've even said "the app just doesn't work" while it clearly works and on a resubmit they suddenly fot it to work. This should not happen, ever!

Web and IE9

There is background audio available. And it's also available with web browser! You can have an HTML5 app that plays music, you can put it into background, lock the phone, the phone play/pause keys work with it etc etc. Nice!

CSS transformations shown, 23 FPS. GPU is used in browser too.

Boston.com loading. Flash logo shown, but they naturally support HTML5 and videos can be watched without Flash bloat. The web browser seems fast and very smooth, even with a big page like this.

Naturally the browser supports geolocation.

Oh, all this was shown on an actual device via camera, no emulators or other stuff.

XNA + Silverlight

Previously with XNA you couldn't make UIs easily. You couldn't use Silverlight on XNA or XNA on Silverlight. Now you can. You can overlay Silverlight on XNA and make UIs that control the XNA game. This will make localization so much easier since you don't have to have lots of resources for different languages.

Also, you can have controls on top of camera feed with raw camera access.


You have raw access to compass and gyro. There is a lot of math done for us so you don't have to care about true north/magnetic north etc. It's done for you. I'm not sure if it's a problem with other platforms, haven't used the compasses.

Sockets, Database etc

No surprise here. Most requested features: sockets and local database access. They're here. As requested. You're welcome.

You have access to contacts and calendar, you have directions selector... With single lines of code.


Fast app resume is there, as with iPhone etc. But what about real multitasking? There are background tasks that allow the app to use some time to do their stuff. At the moment it's about 15 seconds that the app is allowed at a time. It's also inferred that the apps can continue running in the background even after reboot. This would be very nice indeed!

Live tiles updating, battery friendly scheduler, background alerts. You can have multiple tiles for one app that go into different parts of the application.

I hope the live tiles are really battery friendly (Brandon says they really are), at least with Symbian they seem to be really power hungry.

Live Agents

You can pin a part of the application into the home screen. A demo is shown that shows a store selling hardware. You pin an Xbox product info to the main screen, it'll show you e.g. how far you're from the nearest retailer. Click on it and you'll get to the product info in the app. Not the main screen.

Dev Tools

Beta tools available now. Are beta quality, but you can build real apps with them. You can target Windows Phone 7.0 or 7.1 (numbers might change, the latter anyway being Mango).

Demo about a simple app that shows an image that has a PlaneProjection. Reference to sensors API. Create an Accelerometer. Add a delegate. Start the accelerometer. In the delegate change the plane projection with the values gotten from the accel. And the image rotates with the phone. Simple.

Oh, and in the devtools you can now simulate sensor data, especially the accelerometer. You can create XML data for the motions and load them etc. Easy testing with this, for sure!

Naturally you can also simulate GPS data. When will Apple bother to make this possible? With (at least) Qt it's possible on Symbian too.


There is no ambiguity here: every single handset that has WP7 will have Mango available to it. Free of charge.

No Silverlight support in the browser itself at the moment.

Any new stuff in the enterprise management etc? There are some announcements from TechEd, but the enterprise stuff probably isn't as great as it should be, but things are getting better.

Full forward compatibility from 7.0 to Mango. No breaking things.

What about NFC? It's not available now. It's requested, but nothing for Mango. Maybe later.

When will the integration with Ovi Maps/Store etc coming? When the first Nokia phone comes out.

Can you sell apps outside the marketplace? No. Certified app marketplace is important. They are figuring out how to allow for homebrew stuff, but there are security problems. I understand this, but I do want some kind of homebrew stuff to be possible.

When will devs get Mango devices? If you are a developer with a device from Microsoft, it'll come some time in the future. If you buy a WP7 device now, there is no clear release date right now.

Who will have the first Mango devicea available? Anyone who happens to be the first.

Custom shaders in XNA? Much requested, a challenge with the programming model. Looking hard to enable it, but not available right now.

Ruggedized devices running WP7? No information about those, handset maker stuff.

What are the restrictions for developers? There are guidelines, you can download them from the marketplace site.

Operator billing is supported and with Nokia it's even better. People are five times more likely to buy when they have operator billing.

No native code support. None. Sorry. C# is to be used. "That's sad" Brandon: "It's not sad, it's horrible!" So yes, Microsoft would also like to have it, but it'll take time and they do have deadlines.


Jutut.fi  |  Omat jutut  |  Muiden jutut  |  Kategoriat  |   kirjaudu