Different AndroidManifest.xml for low resolution and high resolution

878 views Asked by At

I'll have to split up my app (APK) in two chunks:

  • Low res, which uses low res textures.
  • High res, which uses high res textures.

Now "low" and "high" here is very relative. Low comprises textures in 1x and 2x scales, and high is the same textures at 3x scale. Yes this is an app ported from iOS. Because of size reasons I'll have to make multiple APKs.

So, I have to draw the line somewhere, and I'll likely decide to use low res for devices up to 320 DPI, and high res for devices with DPI beyond that. Like 400 and up, or something. From what it looks like, we can separate DPIs by using the supported-screens tag in AndroidManifest.xml, but it's nowhere clear to me how that actually should be performed, as there is no way to specify the actual DPI. My knowledge might not be enough but I have a hard time grasping how to relate the thing "dp" (essentially points in iOS speak) to "dpi" i.e. density.

http://developer.android.com/guide/practices/screens_support.html

It looks like 320ish dpi in Android-speak is "xhdpi" and stuff above that is xxhdpi and so on (~480 dpi) according to the table:

  • Low res: xhdpi (extra-high) ~320dpi
  • High res: xxhdpi (extra-extra-high) ~480dpi

The question is, how do we require a certain minimum DPI in the manifest file? Also, a maximum DPI would likewise have to be specified for the low res APK?

1

There are 1 answers

3
Ilario On BEST ANSWER

You don't need to create different APK. Just put the texture in the correct folder (drawable-mdpi, drawable-ldpi, drawable-hdpi, ...), Android will keep only the correct density folder for every device. This is why they made the "mipmap" folder for launcher icons:

When app resource optimization techniques remove resources for unused screen densities, launcher icons can wind up looking fuzzy because the launcher app has to upscale a lower-resolution icon for display. To avoid these display issues, apps should use the mipmap/ resource folders for launcher icons.

EDIT: If you really need to then try the compatible-screens tag...