I'm currently trying to support a larger range of devices with my Android app. However, even after reading through what the Android Dev Guide has to say on the issue, I'm unsure as to why I should provide different graphics for ldpi, mdpi and hdpi.
I understand that the images will automatically be scaled, so I can just supply hdpi graphics and let the device do the rest. Will the scaling quality be lower if the device does it? Will it be a performance issue? Right now I'm more worried about multiplying APK size by three.
Base density for Android is mdpi. All other densities are its appropriate ratios, which is as follows: 0.75x — low-density (ldpi) 1.0x — medium-density (mdpi) 1.5x — high-density (hdpi)
For example, if you have a bitmap drawable that's 48x48 pixels for medium-density screen (the size for a launcher icon), all the different sizes should be: 36x36 for low-density (LDPI) 48x48 for medium-density (MDPI) 72x72 for high-density (HDPI)
Why is it problematic to define sizes using pixels on Android? Although screen pixel density varies, this does not impact the use of pixels to define sizes. Large devices always have more pixels, so your UI elements will be e=affected if you define them with pixels.
I can think of two reasons:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With