Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between values folders in Android

Tags:

android

I am new to Android development and was looking for a good explanation of the different values folders in my project. such as values, values-sw600dp, values-sw720dp, values-v11, and values-v14. For example, if I want to say fit an older version of android which folder should I put a copy of my dimens.xml file? Thanks!

like image 273
user2779837 Avatar asked Apr 30 '26 05:04

user2779837


1 Answers

The default values folder would contain the resources to be used by default by your application.

values-v11 and values-v14 contain the resources to be used for API versions 11 and 14 respectively.

The application loads resources from the respective folders based on its API level.

  • values is meant for devices below API 11
  • values-v11 is meant for devices with API between 11 and 13
  • values-v14 is is meant for devices above API 13

If nothing is provided explicitly in the specific folders, then the default values folder is used.

Similarly, values-swXXXdp contain the specific resources based on the density and size of the device, if you are looking to implement different resources according to different device sizes. Again, if nothing is provided, the default values folder is used.

Here is the documentation which would be of help.

like image 168
Swayam Avatar answered May 01 '26 19:05

Swayam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!