0

I have two approaches to get real resolution:

    DisplayMetrics dm = new DisplayMetrics(); 
    getWindowManager().getDefaultDisplay().getMetrics(dm);
    device_value[index++] = dm.widthPixels + "x" + m.heightPixels;

    Display display = getWindowManager().getDefaultDisplay();
    String widthAndHeight = display.getWidth() + " x " + display.getHeight();

<uses-sdk android:minSdkVersion="3"  android:targetSdkVersion="3"/>
<supports-screens android:anyDensity="false" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true"/>

Both of them return "320x569" while the real one is "640x960".

thecr0w
  • 2,148
  • 4
  • 33
  • 59

2 Answers2

1

I believe this is because your target or minimum SDK version is activating Screen Compatibility Mode. You should use higher minimum and target SDK values in your manifest.

Trevor
  • 10,903
  • 5
  • 61
  • 84
1

Conclusion about how to get real resolution:

< uses-sdk android:targetSdkVersion="4"...

< supports-screens android:anyDensity="true"...

DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
String resolution = dm.widthPixels + "x" + m.heightPixels;
slayton
  • 20,123
  • 10
  • 60
  • 89
thecr0w
  • 2,148
  • 4
  • 33
  • 59