Zelig
Zelig

Reputation: 1808

Screen density and emulator

I'm trying to test my application on different screen sizes and densities. To do this, I created several AVDs.

One of them is defined with a WVGA800 screen. This AVD should hence have a large screen with a density of 240. This clearly is a high density display.

My problem is that when I run my application in this AVD, if I call the c.getdensity() function in the onDraw method of my custom view class, it returns 160, which corresponds to a medium density screen. This is consistent with the fact that the application takes the drawable resources in my "mdpi" folder and not in my "hdpi" folder.

What is wrong and how can I create a large screen high density AVD?

Thanks in advance for the time your will spend trying to help me.

Upvotes: 2

Views: 4269

Answers (2)

Zelig
Zelig

Reputation: 1808

I have finally found the source of the problem. I had to explicitly declare in the "AndroidManifest" file that my application supports any screen density by using, outside the application block, the <supports-screens> tag.

Seems Eclipse automatically adds this feature to the generated code.

Upvotes: 0

Walid Hossain
Walid Hossain

Reputation: 2714

When creating New AVD from Android AVD Manager change the value of Abstracted LCD density from Hardware section.

You can get help from here http://developer.android.com/guide/developing/devices/managing-avds.html#createavd

Upvotes: 1

Related Questions