4

I'm trying to support as many android devices as I can for the app I'm writing, but in trying to do so, I discovered a weird problem. I have drawable folders for each screen size & density combination (e.g. drawable-small-mdpi, drawable-large-ldpi, etc.) and layout folders for each screen size qualifier. I set up emulators for testing both the small-ldpi (I just used WQVGA432) and the small-hdpi scenarios (I used the WQVGA skin and set the abstracted density to 240). The problem I discovered is that the small-hdpi emulator accesses the correct layout-small folder, while the small-ldpi (WQVGA432) emulator uses layout-normal and drawable-normal-ldpi folders. It seems strange that the WQVGA emulator would not use the correct resources though its specifications SHOULD be meeting the requirements as listed in the Supporting Multiple Screens article here:

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

Density:

ldpi Resources for low-density (ldpi) screens (~120dpi).

mdpi Resources for medium-density (mdpi) screens (~160dpi).

hdpi Resources for high-density (hdpi) screens (~240dpi).

xhdpi Resources for extra high-density (xhdpi) screens (~320dpi).

Screen Size:

xlarge screens are at least 960dp x 720dp

large screens are at least 640dp x 480dp

normal screens are at least 470dp x 320dp

small screens are at least 426dp x 320dp

WQVGA432:
screen : 240 x 432
density : Low(120)

largeHDPI:
screen : 240 x 432
density : High(240)

Anybody know what the problem is or how to fix it?

1

1 Answer 1

2

There is no certain resolution and density interval for devices, as mentioned at range of screens supported. So this is not a problem, just a trolldroid ^^. Also quoting from the Supporting Multiple Screens document;

  • "Note: These minimum screen sizes were not as well defined prior to Android 3.0, so you may encounter some devices that are mis-classified between normal and large. These are also based on the physical resolution of the screen, so may vary across devices—for example a 1024x720 tablet with a system bar actually has a bit less space available to the application due to it being used by the system bar."
5
  • In that case, how are you supposed to test each of these screen/density combinations? Commented May 17, 2012 at 21:15
  • 1
    try creating AVD with API lvl 11 (Honeycomb) and above, that they claim balanced the judgement mechanism. Good Luck! Commented May 17, 2012 at 21:19
  • I'm required to develop at level 8. Will running the app on a level 11 AVD have any negative effects that I should be aware of? Commented May 18, 2012 at 1:47
  • No, all upper level API have backwards compability for their predecessor. Still, if you have different layouts for small and normal layouts, the result may trick you as it may misjudge the screen size in some rare cases. However, you got to believe google is doing right judgement. Believe me once i tried to implement this system with java, which will give me complete control over resource and layout handling on one of my projects. Even though it succeded, i realized it is not wise to reinventing the wheel. Finally, always test your apps on real devices, or funky results are inevitable. Commented May 18, 2012 at 8:56
  • This helped with a few more of the scenarios I was testing, but, as you said, a few are still kinda weird. Thanks for the help. We have a limited number of test devices to work with, so I'll just have to do the best I can with these wonky emulators. Commented May 18, 2012 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.