Recent Posts
Archives
Categories
Advertisements
Bitesized tidbits for building Modern (Metro) apps.
Windows Phone update codenamed Tango is coming soon and with it comes devices that have a lower amount of memory in them than the usual 512mb, specifically 256mb. Your app needs to take into account whether it should be able to run on phones with 256mb of RAM and is discussed pretty well on MSDN at http://msdn.microsoft.com/en-us/library/hh855081(VS.92).aspx. So is there a quick way in your app of seeing whether the device your app is running on is 256 or 512mb? Yes, and is touched on in that MSDN link, I decided to just extend the code they give to give a quick and easy property that you can have in your app/viewmodel.
The Solution
Really simple, add this to your using list:
using Microsoft.Phone.Info;
Then simply add this property:
public bool Is512Mb { get { try { long result = (long)DeviceExtendedProperties.GetValue("ApplicationWorkingSetLimit"); return result > 94371840; // 94371840 (90mb) is the maximum a 256mb device will have } catch (ArgumentOutOfRangeException) { // The device has not received the OS update, which means the device is a 512-MB device.} return true; } } }
That’s it really.
SL
Pingback: Tango (7.1.1): Detecting Devices With 256MB
I have received that I cannot use the ScheduledActionService in 256, so no Live Tiles update for these devices, so no Live Tiles in 256. That’s not a Windows Phone. Thank you for the tip
Live Tiles can be used on 256mb devices, but they have to come from Push Notifications. It’s only the BackgroundAgent way of updating a Tile that can’t be done.