I have read many things about supporting multiple devices. Right now I have implemented it in my application, I have made following folders as shown below :
According to the note written in this documentation Supporting Multiple Screens, the old groups was deprecated (small, normal, large, and xlarge), which is why we have to migrate to the new technique defined in Android 3.2.
Note: Beginning with Android 3.2 (API level 13), these size groups are deprecated in favor of a new technique for managing screen sizes based on the available screen width. If you're developing for Android 3.2 and greater, see Declaring Tablet Layouts for Android 3.2 for more information.
Old way classification :
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
New way :New configuration qualifiers for screen size (introduced in Android 3.2).
320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
480dp: a tweener tablet like the Streak (480x800 mdpi).
600dp: a 7” tablet (600x1024 mdpi).
720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).
res/layout-sw320dp/main_activity.xml # For handsets (smaller than 600dp available width)
res/layout-sw600dp/main_activity.xml # For 7” tablets (600dp wide and bigger)
res/layout-sw720dp/main_activity.xml # For 10” tablets (720dp wide and bigger)
Refer the Supporting Multiple Screens documentation for more support !!
So here also there will be a weird problem we have that to controlling the different mobile devices (not tablets) i.e we have devices like 3.5' 5', 5.5' and so on.
So to achieve the multiple mobile screen support (accurately) you can create different values folders in your app like below
Then declare all your dimension values in the dimens.xml file as your need , and use the values from the dimension file (it means not hard coded values in your xml files.. every value should be come from dimens file like @dimen/ ) For example in you home screen you have a left padding of 5dp and text size of 24sp and some other dimension values also.
So you need to create a dimens.xml file in your values folder like below.
<dimen name="button_height">120dp</dimen>
<dimen name="buttonTextSize">15dp</dimen>
<dimen name="button_margin">10dp</dimen>
<dimen name="buttonHeight_normal">37dp</dimen>
<dimen name="left_padding">5dp</dimen>
then you can use the same in your xml file like below
<Button
android:id="@+id/rButton"
android:layout_width="wrap_content"
android:layout_height="@dimen/button_height"
android:layout_marginTop="@dimen/button_margin"
android:textSize="@dimen/buttonTextSize"
android:padding="@dimen/left_padding" />
in the same way you can create different dimens.xml files in different values folders and then you can create the same dimension names & change your required sp & dp values.. so that while loading the xml file it will take the dimension values from required values folder
This link may help you for more details
The way you are using is deprecated from android 3.1
. Read the MulitScreen Support
Your layout folder must be as this
res/layout/main_activity.xml # For handsets (smaller than 600dp available width)
res/layout-sw600dp/main_activity.xml # For 7” tablets (600dp wide and bigger)
res/layout-sw720dp/main_activity.xml # For 10” tablets (720dp wide and bigger)
Read the document thoroughly.