HTC Sensation Real Resolution
Asked Answered
D

2

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".

Degradation answered 6/8, 2012 at 7:35 Comment(2)
tried * density: dm.widthPixels * dm.densityDegradation
no, real resolution for HTC Sensation is 540x960Euphemize
D
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;
Degradation answered 8/8, 2012 at 0:48 Comment(0)
A
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.

Advection answered 6/8, 2012 at 7:59 Comment(0)
D
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;
Degradation answered 8/8, 2012 at 0:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.