Galaxy S screen DPI

5k views Asked by At

I am developing and testing an android application on my Galaxy S device, which should be (according to the android dev site) a normal size screen (4 inch) with HDPI (233dpi).

For some reason, drawables that I put in drawable-mdpi are shown instead of the ones in drawable-hdpi. It seems the device "thinks" it's a mdpi device for some reason...

Any ideas?

2

There are 2 answers

1
Ran On BEST ANSWER

Ok, that wasn't too long until I found the solution here, so here it is for others how might get the same problem.

In my android manifest, I did not mention the min sdk version using the element. The default values are 1, which means the application says it supports all versions, including the old 1.x versions.

In the screen support article (http://developer.android.com/guide/practices/screens_support.html) I noticed a rather small sentence: "All applications written for Android 1.5 or earlier are (by definition) designed for the baseline HVGA screen used on the T-Mobile G1 and similar devices, which is size normal and density mdpi."

It seems that since I did not mention a value for min sdk version, my device treats the app as compatible to old versions and ignores the whole screen range support! it then defaults to medium screen and mdpi resources.

Go figure..

1
Loïc Faure-Lacroix On

Here are some ideas. Could you log the output of the screen density

http://developer.android.com/guide/practices/screens_support.html

http://developer.android.com/reference/android/util/DisplayMetrics.html

Log the content of the displayMetrics that could help you find out if there is something wrong with the display used. For compatibility android might run with lower dpi.