Reputation: 857
I have developed an app for Android and I need to run my app on different devices - especially on devices with 1280x720 and 480x800 resolutions.
Which layout folders do I have to create?
Thanks in advance.
Upvotes: 0
Views: 1064
Reputation: 541
I recently finished my App and I did not use any of the screen size qualifiers, but instead I used the screen density and smallest width qualifiers:
layout/layout-land
layout-sw480dp/layout-sw480dp-land
layout-sw6000dp/layout-sw600dp-land
layout-sw720dp/layout-sw720dp-land
I also used dimens.xml files across the same folders above and mdpi/hdpi/xhdpi/xxhdpi.
I am no expert..I am working with Android for about two months now, but this is the help I can give ;)
Upvotes: 1
Reputation: 2057
for 1280x720 (4.7 inch) u need to create
res/layout-xhdpi/urxml
res/drawable-xhdpi/urresorces
values-xhdpi/dimens //add dimensions
for 480 x 800 (4. inch) u need to create
res/layout-hdpi/urxml
res/drawable-hdpi/urresorces
values-hdpi/dimens //add dimensions
again for 480 x 800 (5.1 inch) u need to create
res/layout-large-mdpi/urxml
res/drawable-large-mdpi/urresorces
values-large-mdpi/dimens //add dimensions
and for more info refer my comment
Links to restrict for specific devices
Restrict sales of an app by specific devices?
Android: Limit supported devices in Android Market
Upvotes: 0
Reputation: 4092
Layout folder like this way.
res/layout/my_layout.xml // layout for normal screen size ("default")
res/layout-small/my_layout.xml // layout for small screen size
res/layout-large/my_layout.xml // layout for large screen size
res/layout-xlarge/my_layout.xml // layout for extra large screen size
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation
In Manifest add support-screens
<supports-screens android:resizeable=["true"| "false"]
android:smallScreens=["true" | "false"]
android:normalScreens=["true" | "false"]
android:largeScreens=["true" | "false"]
android:xlargeScreens=["true" | "false"]
android:anyDensity=["true" | "false"]
android:requiresSmallestWidthDp="integer"
android:compatibleWidthLimitDp="integer"
android:largestWidthLimitDp="integer"/>
For more info check this http://www.kandroid.org/guide/practices/screens_support.html and http://developer.android.com/guide/practices/screens_support.html
Upvotes: 0
Reputation: 24848
layout not taken based on v19 or v1 version which taken base on device resolution :
layout // layout for normal screen size ("default")
layout-large // layout for large screen size
layout-xlarge // layout for extra-large screen size
layout-xlarge-land // layout for extra-large in landscape orientation
More detail Check : http://developer.android.com/guide/practices/screens_support.html
Upvotes: 0