Do I need 14 different layouts to support all Android devices?
Your app will work on 100% of the devices with the classic layout.
You can just add some buttons or change the layout in landscape mode by adding some qualifiers but that's up to you!
For instance, on LDPI (small resolution) device, you may want to adjust some buttons or change a little bit to fit the small screen.
You may also want to put some buttons on the right in landscape mode and in the bottom of your layout in portrait!
You do not "have to" use them.
Best way to support multiple screens? - Android
If you want different layouts for different screens, then yes, you'll need separate layouts for each. If you want the same layouts to just scale, then all you need to do is make sure all of your sizes are in dp or sp, don't use px anywhere. Android will take care of the rest.
As far as images go, you should have them in different resolutions even if you don't have separate layouts so they look better in varying screen densities. I'd say at least have mdpi and hdpi resolutions of each image.
applying resolution for different devices
Its just a example:
Device resolution-
res/values/dimens.xml(default)
res/values-ldpi/dimens.xml (240*320 and nearer resolution)
res/values-mdpi/dimens.xml (320*480 and nearer resolution)
res/values-hdpi/dimens.xml (480*800 and nearer resolution)
res/values-xhdpi/dimens.xml (720*1280 Samsung s3,Micromax HD canvas etc)
res/values-xxhdpi/dimens.xml (1080*1920 samsung s4,HTC one etc)
Tablet resolution-
res/values-sw600dp/dimens.xml (600*1024)
res/values-sw720dp-land/dimens.xml (800*1280)
<TextView
android:id="@+id/textView1"
style="@android:style/TextAppearance.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample Text - Small" />
<TextView
android:id="@+id/textView2"
style="@android:style/TextAppearance.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample Text - Medium" />
<TextView
android:id="@+id/textView3"
style="@android:style/TextAppearance.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample Text - Large" />
How to support different screen size in android
For Different screen size, The following is a list of resource directories in an application that provides different layout designs for different screen sizes and different bitmap drawables for small, medium, high, and extra high density screens.
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
res/drawable-mdpi/my_icon.png // bitmap for medium density
res/drawable-hdpi/my_icon.png // bitmap for high density
res/drawable-xhdpi/my_icon.png // bitmap for extra high density
The following code in the Manifest supports all dpis.
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
And also check out my SO answer.
multiple screen support in android
http://developer.android.com/guide/practices/screens_support.html
You have to add different folder for different layout in res folder --> hdpi,mdpi,ldpi and for large screens you xhdpi(for Tablet) and large-hdpi or xlarge (for NXzoom). Also set Images and text size different in different layout as per screensize...
How to set android layout to support all screen sizes?
Please go through the following links. These might help you:
Supporting Different Screen Sizes
Supporting Multiple Screens
Supporting Different Densities
Supporting Tablets and Handsets
AFAIK, the only way to support all screens is by doing that folder bifurcation. Every XML file goes up to a few kilo bytes. So, size shouldn't be too much of an issue as such.
Related Topics
Alertdialog.Getbutton() Method Gives Null Pointer Exception Android
Find Current Location Latitude and Longitude in Android
How Does Native Android Code Written for Arm Run on X86
How to Implement My Own Disk Cache with Picasso Library - Android
Proguard with Ormlite on Android
How Could I Filter the Listview Using Baseadapter
Android Listview Row Delete Animation
Android: Notifydatasetchanged(); Not Working
Android: Gles20: Called Unimplemented Opengl Es API
Adding Your Own SQLite Database to an Android Application
Error "Activity Class Does Not Exist" When Launching Android App with Adb Shell Am Start
How to Launch Front Camera with Intent
How to Import Eclipse Project to Android Studio
Why Is My Android Emulator Keyboard in Chinese Character Mode