android screen size,values-v11,values-v14
Asked Answered
T

3

18

I found several values folders in my res folder:

xlarge screens are at least 960dp x 720dp
large screens are at least 640dp x 480dp
normal screens are at least 470dp x 320dp
small screens are at least 426dp x 320dp  
res/values-normal/ ==    res/values-v11/ ???
res/values-xlarge/ ==   res/values-v14/  ???

Am I right? Or do I need to create another folder called values-xlarge, values-normal?

Tapioca answered 31/8, 2012 at 19:52 Comment(0)
W
50

values-v11 is the values of the API version 11, and values-v14 is the values of the API version 14.

It's worth indicating that i.e. values-v11 will be used for API 11 and higher, unless there's another folder that got higher version. For example if you got values-v11 and values-v14 folders, then values-v11 and will be used on APIs 11, 12, 13 but on API 14 and higher, content of values-v14 will be used

Witham answered 31/8, 2012 at 19:54 Comment(4)
And if I were to have values, values-v11 and values-v16, and if I were to delete all except values, would it result in an error, or would all API versions take the same styles folder?Tryptophan
In that case all API versions will take the 'values' directory.Reword
This is not totally accurate. It should be values-v11 is values for >= API version 11, until a next defined version. In this example values-v11 will match API 11-15 and values-v16 wil match >= API 16Prostitution
Yep, that's important note. I edited my answer, thanks for pointing that out.Pravit
P
8

No, this "equation" is not correct:

res/values-normal/ == res/values-v11/ ???
res/values-xlarge/ == res/values-v14/ ???

xlarge defines screen size (so these values will be used on device with display matching xlarge requirements) while v14 determines API version (Ice Cream Sandwitch - see here). It is not guaranteed (or even assumed) that every xlarge devices have to be running v14 API or that every ICS device features xlarge screen.

Pravit answered 31/8, 2012 at 19:54 Comment(2)
Case in point: Galaxy S II is a large screen, and can have v9, v10, v14, or v15.Hymeneal
In general if you can plant custom firmware, API version it can be anything you can use, however you cannot change hardware specs that easily.Pravit
R
3

v11 in values-v11 is a qualifier for Android sdk version v11.

Take a look at http://developer.android.com/guide/topics/resources/providing-resources.html for a detailed description about how Android supports resources for different sdk versions, screen, languages or other device configurations.

http://developer.android.com/guide/practices/screens_support.html contains a more detailed explanation about supporting multiple screen dimensions.

Reword answered 9/2, 2013 at 13:27 Comment(3)
How do I can define values for pre-ICS and values for ICS+ ??? Do i have to specify each platform indepently? or values-v10 will work from GB onwars?Cheesewood
Put all your pre-ICS resources in the 'values' directory and put all your ICS+ resources in the 'values-v14' directory. v1-v13 will map to the 'values' directory and v14+ will map to the 'values-v14' directory. You can use the version qualifier in all resource directories. So layout-v14 will contain all v14+ layout files.Reword
I should asked this on a Independent question, so you can mark you as valid answer!!!!Cheesewood

© 2022 - 2024 — McMap. All rights reserved.