1

低メモリデバイス(Nokia Lumia 610など)を実行しているユーザーのアプリでライブタイルを有効にするオプションを削除しようとしています。Microsoftから入手した以下のコードを使用していますが、Lumia800とFocusi917を実行している数人のユーザーが、これを追加するとライブタイル機能が失われたと報告しています。

低メモリデバイスを検出する適切な方法は何ですか?

これは私が使用しているコードであり、エミュレーターとほとんどのユーザーで明らかに機能しますが、すべてではありません。

long result = 0;

try
{
    result = (long)DeviceExtendedProperties.GetValue("ApplicationWorkingSetLimit");
}
catch (ArgumentOutOfRangeException)
{
    //The device has not received the OS update, which means the device is a 512-MB device.
}

if (result < 90000000)
{
    //Low memory device
}
4

1 に答える 1

5

私はこのコードを使用します。問題はおそらく絶え間なくあります。私のものは低メモリデバイスに関するMSDNページからのものです:256MBデバイス用の開発

/// <summary>
/// Flag if device is Low-memory Tango device or not.
/// </summary>
public static bool IsLowMemDevice
{
    get
    {
        if (!isLowMemDevice.HasValue)
        {
            try
            {
                // check the working set limit 
                long result = (long) DeviceExtendedProperties.GetValue("ApplicationWorkingSetLimit");
                isLowMemDevice = result < 94371840L;
            }
            catch (ArgumentOutOfRangeException)
            {
                // OS does not support this call => indicates a 512 MB device
                isLowMemDevice = false;
            }
        }
        return isLowMemDevice.Value;
    }
}
private static bool? isLowMemDevice;
于 2012-10-11T07:24:04.100 に答える