I didn’t really understand the DP measure, even though I’ve read about it 2 times.
Let’s say I have an image it’s resolution is: 400 X 400 PX.
And I want to put it as background image to my app.
and I’m putting the same image on the different drawable folders(ldpi,mdpi,…)
Would the image strech? I don’t know what resolution the image should be on the different drawable folders so it will fit the devices.
Your base density is
mdpi. So your 400×400 dp image will be rendered as is onmdpidevices only. If you want the same size onldpi, you have to scale your image by0.75. Forhdpiyour image needs to be1.5times bigger and forxhdpidevices,2.0times the size of yourmdpi.As
mdpiis your base, I always put drawables inres/drawable-mdpifolder while developing. Once I got code ready for release I addhdpiresources tores/drawables-hdpi. I personally do not careldpidevices as mostly no device I target is lower density thanmdpiand if anyone will have such, then I am fine with android framework doing the downscale. But the upscaling is other story – you will always get bad results (blurry images) as you simply cannot technically make bigger bitmap from smaller without artifacts (no, CSI lies 😉 – you simply got not enough data so you have to extrapolate. So it’s better to provide proper drawables yourself or your end users would complain and your app may look not as nice as it could.