My app is compatible with Android 1.6 – Android 4.0.3. I want my drawables to target each platform from start to end with all the relevant qualifiers (x|h/m/ldpi & swxxxdp) where the system theme changed.
Off the top of my head, 1.6 – 2.2 was one theme, 2.3.x was 1 theme, 3.0x was another theme and now 4.0x is another theme.
Currently, my res folder looks like this:
- drawable
- drawable-hdpi
- drawable-hdpi-v11
- drawable-hdpi-v9
- drawable-ldpi-v9
- drawable-mdpi-v11
- drawable-mdpi-v9
- drawable-sw320dp
- drawable-sw600dp
- drawable-sw720dp
- drawable-v11
- drawable-xlarge
With each Android version, I feel my res folders are less efficient than they could be. Having looked at the ICS source res, there are only a few base drawable folders, the others are mainly language specific.
My question is a) how to organise my drawables folders to target each theme correctly & b) am I doing something wrong with the folders at the moment?
(1) To optimize the APK size, try create alias resource.
http://developer.android.com/guide/topics/resources/providing-resources.html#AliasResources
(2) Conflict between swxxxdp and vxx resource.
According to resource folder searching priority, it would match swxxxdp folder before vxx.
As smallest width has higher priority compare version.
(Version is the lowest priority qualifier)
Read best match for some clues:
http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch