Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclusive Layouts for certain api level - Android

I have a Layout that I would like to use only for tablets. I know that if create a folder "layout-v(api level)" that layout will be used only for that specific api. the thing is, for tablets, either you have api 11, 12, or 13. Is there a way I can create a folder that includes all of these instead of creating layout-v11, layout-v12, layout-v13 ?

Hope my question is not confusing, i just dont know how to put my question any other way.

Thanks

like image 286
Akash Avatar asked Dec 04 '22 14:12

Akash


2 Answers

If you use layout-v11 it will be used for all versions >= 11 unless a higher version is specified (e.g. layout_v14). So you should only need to make the one folder, layout-v11.

like image 132
Kevin Coppock Avatar answered Dec 07 '22 04:12

Kevin Coppock


Don't forget that you can have a 4" android device with API lvl 14. So using API version to distinct tablets and phones is not a good way.

Prefer the distinction with screen resolution. A good post about it is on the Android developers blog:

http://android-developers.blogspot.fr/2012/07/getting-your-app-ready-for-jelly-bean.html

like image 27
Aerilys Avatar answered Dec 07 '22 02:12

Aerilys