I have a android application, that uses many images. and application is to be used on different resolutions. I am using only one set of images and images are saved in “drawable-mdpi”.
So “The images gets blur when I run it on a high resolution”.
So probably the solution of this is to save different images of different resolution in drawable-hdpi,ldpi etc.
Is doing this is enough or do I have to change the images by code? or phone automatically adjust the perfact image into the drawables.
can anybody provide a example??
If you put the images in the
ldpi,mdpi,hdpiorxhdpifolders Android chooses the images according to the current device dpi.If you only add
mdpiressources and load them on ahdpidevice Android will enlarge the images with a factor of1.5if you open them on aldpidevice they will be shrunk with a factor of0.75.The scaling is applied so that the images have (almost) the same physical size all displays with any dpi.
You should add different images for each dpi if those images will be blurry (or loose details when shrinked) after this autoscaling. If you have simple images that look well after scaling you only need to add one image to any dpi folder.
EDIT:
On Android there is no default way for automatically selecting images depending on the screen resolution. As the docs says:
(see Supporting multiple screens).