Android: Values priority
android, device
Solution
You can find the priority of resource folders here in this page. Basically it is used to support different devices and configurations.
Android uses a certain logic to determine the best possible matching resource folder for a device. This is explained in this documentation page.
Regarding your devices query:
- First: 480 * 800 hdpi v14 -- values-hdpi
- Second: 320 * 480 mdpi v17 -- values-mdpi
- Third: 720 * 1280 hdpi v17 -- values-w480
In the list provided by you, `values-w480 (devices with lowest width of 480dp, only from API 13)` has got the highest merit. So whichever device meets that criteria, it'll take resources from that folder.
The `values-vXX (devices with API >= XX)` has got the lowest merit. So if the other folders are not taken, then only Android takes resources from this folder. Check the table listing the resources qualifiers for more info on that topic. The resource qualifiers are listed in the table in the order of precedence of resource qualifiers.
- First case: Normal hdpi - less than 480dp width -- So values-hdpi
- Second case: Normal mdpi - less than 480dp width -- values-mdpi (values-mdpi has got more weightage than values-v17)
- Third case: hdpi device with width of 480dp (720/1.5 = 480) API 17 -- values-w480
Problem
In my app in the `res` folder, there are values folders for different devices. For example: values-mdpi Values-hdpi values-v14 values-v17 values-w480 values-w720 etc. I wonder what is the priority of these folders for Android? Let's imagine couple devices: ``` first : 480*800 hdpi v14 second: 320*480 mdpi v17 third : 720*1280 hdpi v17 ``` What folder would Android use for each of them?