Reputation: 453
I am implementing an app both for phone
and tablet
. I am not sure which layout folder
and value folder
are to be included in the project.Can anyone give me some idea about the layout folders
to be included in the res
folder of the app.
Upvotes: 0
Views: 1879
Reputation: 113
For tablet, you must create folders with suffix
for 7':
values-large
layout-large
for 10':
values-xlarge
layout-xlarge
In theses folder, put a copy of some of your dimens.xml, integer.xml, layout.xml
Upvotes: 0
Reputation: 570
You can Use one Layout file to Use the all the Screens.
In above Picture the layout
file is one for all screens by the Use the different values
(dimens) folder.
values-w320dp ===> For Mobiles
values-w480dp ===> For 7 inch Tablets
values-w820dp ===> For 9 and 10 Tablets
The same drawable
like in the Picture
drawable-normal-hdpi
==>For Mobiles
drawable-large-hdpi
==>For 7 inch Tablets
drawable-xlarge
==>For 9 and 10 Tablets
In Layout File :
android:layout_marginRight="@dimen/login_edittext"
the login_edittext
must be mention in all dimens folder at respective values
In values-w320dp
inside the dimens.xml
<dimen name="login_edittext">15dp</dimen>
In values-w480dp
inside the dimens.xml
<dimen name="login_edittext">30dp</dimen>
In values-w820dp
inside the dimens.xml
<dimen name="login_edittext">40dp</dimen>
I think It will be help you..
Upvotes: 7
Reputation: 1513
According to http://developer.android.com/training/basics/supporting-devices/screens.html:
MyProject/
res/
layout/ # default (portrait)
main.xml
layout-land/ # landscape
main.xml
layout-large/ # large (portrait)
main.xml
layout-large-land/ # large landscape
main.xml
This will help with the available options: http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources
Upvotes: 0