Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

What is best way to detect a 512 MB device

Discussion in 'Windows' started by jeffweber, Sep 20, 2014.

  1. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    I'd like to turn of things off for 512 MB devices like the Lumia 520/521.

    Is there an easy way to determine this programmatically?
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,658
  3. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    Would SystemInfo.systemMemorySize be a reliable check to make on a Windows Phone? I really don't want to target a device type, I want to target all phones/devices with 512 MB (or less).

    -Jeff
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    SystemInfo.systemMemorySize is reliable, though it's not exactly accurate. It would report somewhere between 400-500 MB on 512 MB devices. Still, if you detect that memory size is lower than say, 600 MB, you can be sure it's a 512 MB device.
     
  5. elissa-tong

    elissa-tong

    Joined:
    Jun 25, 2013
    Posts:
    9
    Came across this article: How to disable features in apps for lower-memory phones for WP8
    http://msdn.microsoft.com/en-US/library/windows/apps/hh855083(v=vs.105).aspx/html

    If you don't do it programmatically, you can make a restriction in Package.appxmanifest (WP8.1). This actually prevents the app from showing up on the Windows Phone Store if the user has a 512 MB device.

    <Packagexmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" m2="http://schemas.microsoft.com/appx/2013/manifest"xmlns="http://schemas.microsoft.com/appx/2010/manifest">
    ....
    <Prerequisites>
    <m3:MinDeviceMemory>1GB</m3:MinDeviceMemory>
    </Prerequisites>

    In WMAppManifest.xml (Windows Phone 8.0), add a Requirement:

    <Requirements>
    <RequirementName="ID_REQ_MEMORY_300" />
    </Requirements>

    http://msdn.microsoft.com/library/windows/apps/jj681682(v=vs.105).aspx/html
     
  6. Darkays

    Darkays

    Joined:
    Mar 31, 2013
    Posts:
    176
    While it is possible to hide your app from 512mb users, I would advise against it. Many Windows Phone users have those types of phones, and not including them would be a bad idea.

    There was a post on the Windows blog a while back giving some tips on how to optimize for low level devices. http://blogs.windows.com/buildingapps/2012/03/07/optimizing-apps-for-lower-cost-devices/

    Other ways to reduce memory usage is to make sound files stream from disc rather than loading into memory and compressing images on the phone specifically for WP.
     
  7. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I check for device memory being less than 600 as someone mentioned above. Works great.
     
  8. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    Yep, that's what I went with as well. Works perfect.
     
  9. Lukas-Labaj

    Lukas-Labaj

    Joined:
    Nov 22, 2012
    Posts:
    36
    this solution doesn't work, try this one : http://sertacozercan.com/2014/12/how-to-opt-out-of-low-memory-devices-on-windows-phone-8-1/

    it's working for me :)