how to differentiate the 480X800 and 480X854 screens in android?

Praveen picture Praveen · Jun 9, 2010 · Viewed 8.2k times · Source

how to differentiate the 480X800 and 480X854 screens. we have an option to put the one image at the hdpi folder.in my case 480X800 image is does not support for the 480X854 image. it shows a blank space at the bottom.Any Idea?

Edit: i set the image as a background. on my layout i have transparent image views with margins. if i click the image view it do some task. but between these two screens. i can adjust the value for one. in another one the image was strectched slightly. then what can i do? can you understand my problem? please help.

Answer

Christopher Orr picture Christopher Orr · Jun 9, 2010

You shouldn't really have to differentiate between the two; you should make a best effort to just support each screen density rather than specific screen resolutions. Otherwise, you'll end up in a mess when devices with yet-different screen resolutions come out. This is why we have nine-patch images! :)

See also this question:
What resolution should my Android splash screens be?

If you absolutely need to differentiate between the two, you can use the long and notlong resource qualifiers. e.g. WVGA is values-hdpi-notlong and FWVGA is values-hdpi-long.
Apparently this isn't correct, which is all the more reason to not differentiate and create generic resources that can handle small changes in resolution.