Android - Extra large images placed in res/drawable-xhdpi aren't showing on tablet emulator, why?
Asked Answered
V

2

2

My app seems to be working on different sized screens well, apart from the tablet sized screens.

The way I have worked, is using a relative layout, which has lots of images. The images then have different sizes put in the folders, which will be picked up depending on which images the phone use ( depending on size )

The folders I use are:

drawable-hdpi

drawable-mdpi

drawable-ldpi

^ These were already added when I created the project in eclipse.

I read, and added drawable-xhdpi with the expectation that the larger screens would use this. I then put the images in, and my layout looked tiny on the android 3.0 emulator. So, I then put a mark on one of the images in xhdpi, and found that the tablet emulator isn't actually using this images.

Any ideas why? Does something need to go in the manifest?

Vevina answered 24/2, 2012 at 17:2 Comment(0)
E
2

This can sometimes happen with 'compatability mode'

http://developer.android.com/guide/practices/screen-compat-mode.html

You can declare that you support these extra large screens like this:

 <supports-screens android:xlargeScreens="true" />

or try declaring that you target SDK version 13, this will turn compatibility mode off. however this has other side-effects

 <uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="13" />

It's all documented in the above link

Enkindle answered 18/4, 2012 at 15:38 Comment(0)
M
5

xhdpi is "extra high DPI" (e.g. the Galaxy Nexus, small screen, big resolution), most tablets do not fit in this category. You're probably looking for drawable-xlarge.

Mercuric answered 24/2, 2012 at 17:6 Comment(3)
Hmmm. How do I go about making the larger screens ( drawable-xlarge ) use the larger images and scale them up? I was hoping the idea here would be that it uses the different images to ensure it looks consistent on all devices. How can I do that? This seems to look ok on my HTC Desire Z, and a HTC hero, I believe as it's using different images. I'm now really stuck. Is it as simple as putting it in a new res folder?Vevina
Android will always scale the best quality image you have provided up or down to fit the current screen. So if you provided only hdpi or xhdpi images they should get scaled to the tablet size by Android automatically.Mercuric
You're spot on. xhdpi does not necessarily mean big screens, but high resolutionHuskamp
E
2

This can sometimes happen with 'compatability mode'

http://developer.android.com/guide/practices/screen-compat-mode.html

You can declare that you support these extra large screens like this:

 <supports-screens android:xlargeScreens="true" />

or try declaring that you target SDK version 13, this will turn compatibility mode off. however this has other side-effects

 <uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="13" />

It's all documented in the above link

Enkindle answered 18/4, 2012 at 15:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.