Windows Phone Development–Developing for 256 MB (low profile) Windows Phone Devices

Microsoft has announced that upcoming Windows Phone 7.5 Refresh code named as “Tango” will have low profile 256 MB devices which would make Microsoft’s entry in to mobile market by delivering low cost Windows Phone devices.

All existing Windows Phone devices are having 512 MB RAM, considering the mid-range or low entry market Microsoft has included the support for 256MB Windows Phone devices.

Feature Limitations on Windows Phone – 256MB Devices

You can use most features offered in Windows Phone OS 7.1 on 256-MB devices with no performance issues. However, generic background agents are not supported on 256-MB devices, and a few additional features should be used with care so you do not exceed the memory limit of the application.

 

Additionally Microsoft has released the restrictions/limitations for 256MB “Tango” (Windows Phone 7.5 “REFRESH”) devices.

  • Windows Phone Marketplace app restrictions – Some processor-intensive apps have memory requirements, and won’t work on phones with 256 MB of RAM. You can check how much memory you have on your phone by tapping Settings > About.
  • Podcast Subscriptions and Video Podcasts – You won’t be able to manage podcast subscriptions on your phone or watch video podcasts if your phone has 256 MB of RAM.
  • Local Scout – You won’t be able to use Local Scout if your phone has only 256 MB of RAM.
  • Fast app switching – This feature will work if your phone has 256 MB of RAM. But applications that use over 90MB will be killed immediately after deactivation.
  • SkyDrive automatic photo upload – You won’t be able to upload pictures automatically to SkyDrive if your phone has only 256 MB of RAM.
  • HD video playback – You won’t be able to play video compressed with some of the listed codecs if your phone has 256 MB of RAM.
  • Background agents – To free up RAM for the foreground on 256MB devices, generic background agents (Periodic Tasks/ResourceIntensiveTasks) are disabled.

 

Tools Required for Development

You would need Windows Phone SDK 7.1.1 Update which includes the support for 256 MB windows Phone device application development. (Of course this is an update which needs to be installed after installing Windows Phone SDK 7.1 )

Windows Phone SDK 7.1.1 Update includes a new 256 MB emulator apart from usual 512 MB emulator and you can toggle between these emulators using the devices menu on Visual Studio 2010.

Windows Phone SDK 7.1.1 Update also includes the support for Windows 8. Now you can install and develop Windows Phone applications on your Windows 8(currently Consumer Preview / BETA).

 

Things to consider when developing for Windows Phone – 256MB Devices

1. Make you application to stay within Application Memory Limits of the Device

Windows Phone – 256MB will have a an Application Memory limit of 90MB, any application that use over 90MB will be immediately killed after deactivation. That means the application will not remain in resident ready to wake up. The application will be killed by OS to save up resources.

While doing development you can check Application Memory Limit on a device using ApplicationWorkingSetLimit parameter for DeviceExtendedProperties.GetValue(string) method.

For example:

 <span class="kwrd">long</span> result = 
    (<span class="kwrd">long</span>)DeviceExtendedProperties.GetValue(<span class="str">&quot;ApplicationWorkingSetLimit&quot;</span>);

 

2. Avoid Generic Background Agents

You would need to have special care when using generic background tasks such as

  • Resource-intensive tasks
  • Periodic tasks

You will have to efficiently manage the resource intensive tasks and empty the task after the completion.

When you try to add one of these background agents in your application using the Add(ScheduledAction) method and passing a PeriodicTask or ResourceIntensiveTask, either on a 256-MB device or on the 256-MB emulator, an InvalidOperationException exception occurs, which indicates that the maximum number of background agents for the device has been reached. (MSDN)

3. Detect the memory limit and change application behavior

If you use a background agent in your application, and you want your application to run on all types of devices, you should check the working memory of the device and not use the background agent on a 256-MB device.

See How to: Disable Features of an Application for a 256-MB Device. (MSDN)

4. Reduce Graphics and Audio Memory Use

When you develop applications and games to run on 256-MB devices, you should be careful about how you use graphics in the game or application. Graphics and audio memory often are not pageable. Too many audio or image resources, textures, and animations can exceed the memory limits of a 256-MB device.

 

5. Consider performance optimization and reduce the application memory usage to maximum optimal

So that the OS will not have to kill your application even if it is deactivated or in dormant stage.

  • Try using the respective launchers and choosers for any purpose relating to it.
  • Avoid having heavy graphics intensive animations.
  • Handle device orientation changes gracefully

 

Restricting our application not installable on 256MB Devices

If your application is resource intensive and you are sure that this application will not work on 256MB devices, you can opt out of getting it installed on 256MB devices.

There is an option called “Requirements” available in WMAppManifest.xml file under “Capabilities” section. and you just have to set attribute value “ID_REQ_MEMORY_90” to the Requirements element .

For example:

&lt;/Capabilities&gt;
&lt;Requirements&gt;
      &lt;Requirement Name=<span class="str">&quot;ID_REQ_MEMORY_90&quot;</span> /&gt;
&lt;/Requirements&gt;

This option will restrict the application getting installed from Windows Phone market place. But still as a developer you can deploy the application to 256 MB Emulator and developer devices.

 

That’s a quick gathering of information from what I learned from MSDN, we need to consider all these aspects when we are programming for an application that will support on all the Windows Phone devices. I hope you gained some knowledge out of this post.  If you need further details, you can refer MSDN: Developing for 256-MB Devices, which is my primary reference source of information as well.

References:

MSDN: Developing for 256-MB Devices

MSDN – How to: Disable Features of an Application for a 256-MB Device.