0

My Android application is not loading the correct graphic images when running on a Galaxy tab 1.0. They look blurry and slightly pixelated.

My guess is that it is loading the images from the mdpi folder, because the device density is 1.0, but they are small for the tablet screen.

What should I do in this case? I don't want to increase the size of the images in the mdpi folder, because I have tested the application in a fair quantity of emulators and devices and it worked well, but I still want a way of loading bigger images for the tablet.

The device model is GT-P7510 and Android version is 3.1. The density of the device is 1.0, which I got using the code:

getResources().getDisplayMetrics().density

I have different image sizes placed in the folders:

  • drawable-hdpi
  • drawable-ldpi
  • drawable-mdpi
  • drawable-xhdpi

I am developing in API level 8, platform 2.2.

Thanks!

Gustavo Pagani
  • 6,583
  • 5
  • 40
  • 71

1 Answers1

1

you should probably create

res/drawable-large-mdpi/

and put resources for large screens there. Instead of large you may evaluate to use other qualifiers, such as drawable-sw600dp, see http://developer.android.com/guide/practices/screens_support.html and http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch

  • it definitely works, I just copied all the images from the xhdpi folder to this new large-mdpi folder. My concern is if I'm not covering any other case like this. What would be the perfect combination of folders that I have to create to cover all screen sizes and dpis available in the market. – Gustavo Pagani Aug 28 '13 at 13:17
  • well I guess it depends on what you need on different devices.... :) but I guess once you have a rough idea of what to do on phones and what on tablets you can prepare a couple of layouts and then use different dimen to tweak the two families according to densities and resolutions. you may find interesting http://www.youtube.com/watch?v=zHirwKGEfoE for some hints on responsive design – Francesco Mapelli Aug 28 '13 at 16:43