2
votes

What are the recommended sizes for drawable: LDPI, MDPI, HDPI, XHDPI, XXHDPI, XXXHDPI or i can use same size image for all and change it programatically like changing in width and height?

2
You want your images to match the pixel density of the respective device class. An image with too small resolution leads to bad quality and an image with too high resolution to increased memory needs and runtime.Henry
ok thanks for replyingShahzaib

2 Answers

3
votes

Inside Android Studio, if you right click on the res folder, you can select New > Image Asset which will create properly sized drawables for those dpi bucket folders.

Optionally, you can also use a website like this one: http://romannurik.github.io/AndroidAssetStudio/index.html

You can also programmatically change width/height, but this is heavily discouraged due to how disgusting a smaller image looks when it's stretched large. Only use this programmatic solution if you use vector images.

4
votes

The relationship between the various proportions is as follows:

LDPI - 0.75x
MDPI - 1.0x (original size)
HDPI - 1.5x
XHDPI - 2.0x
XXHDPI - 3.0x
XXXHDPI - 4.0x