android build tool adds v4 qualifier to drawable folders by default in generated apk
Asked Answered
C

0

8

I have been confused for quite a long time.

before build tool v21.0.0, the packaged apk contains the drawable folder structure as below:

res/drawable-hdpi
res/drawable-ldpi
res/drawable-mdpi
res/drawable-hdpi

However, things changed since v21.0.0, the unzip folder structure comes with suffix:

res/drawable-hdpi-v4
res/drawable-ldpi-v4
res/drawable-mdpi-v4
res/drawable-hdpi-v4

My questions are:

  1. Why added v4 suffix to the drawable folders by default? In current days, the apps are normally build on a much higher version of API. I don't feel like it is necessary to add the v4 qualifier.
  2. Why since v21.0.0? I have gone through almost all the version of build tools and this only happens since v21.0.0.
  3. Will there be another qualifiers like v6, v9 or etc in the future?

Thank you so much in advance.

Carolinecarolingian answered 29/2, 2016 at 13:2 Comment(4)
Are you using support library in your project?Royroyal
"Why added v4 suffix to the drawable folders by default?" -- well, those densities were not supported before then. "Why since v21.0.0?" -- if I had to guess, it is tied to vector drawable support, but that is just a guess. "Will there be another qualifiers like v6, v9 or etc in the future?" -- probably not, but that too is just a guess.Lukasz
@Silvans Solanki I created two projects, one with the support library with min API 8 and the other with no support library with min API 16. The decompiled apks shows that both of them have the -v4 suffix added to the drawable foldersCarolinecarolingian
@Lukasz you are right, that really make sense to add the v4 suffix to indicate the folders are supported for api4 or above. I guess google team are trying to make more sense with the folder naming.Carolinecarolingian

© 2022 - 2024 — McMap. All rights reserved.