What are the various screen sizes in Android devices. I have three screen sizes which are 320X480, 420x00(Samsung Galaxy Player5.0), 600X1024(Samsung Galaxy Tab Sprint). How do I get my project/app in all devices with correctly fitted in all screen sizes.
-
check out my detailed answer here: http://stackoverflow.com/a/12742888/1369222 – Anup Cowkur Jan 28 '13 at 10:53
2 Answers
here i am sending you an image for different screen sizes and densities.it will be help ful to you.
- 1,491
- 6
- 23
- 46
Ok, so what you have to know is that support-screens doesn't make your application look 'nice' on screens you are supporting (check this link). It just tells that users with such screens will be able to download your application, but it's up to you to make it display properly. You have to create layouts for specific screens on your own.
More about it you can read in Android's documentation: http://developer.android.com/guide/practices/screens_support.html
Basically, you have to properly name your directories in which layout files are stored in order to let Android know which one should it pick up for specific device. If for example your layout's file was "layout.xml" you should have:
/res/layout/layout.xml // Default layout
/res/layout-small/layout.xml // Small screens
/res/layout-large/layout.xml // Large screens
/res/layout-xlarge/layout.xml // Extra large screens
You can go even further and make also different layouts for portrait and landscape views by specyfing another keyword in directory's name:
/res/layout-small-land/layout.xml // Small screens, landscape view
/res/layout-small-portrait/layout.xml // Small screens, portrait view
Remember that tags order is important, so you can't write layout-portrait-small.
And last add this code to your AndroidManifest file:
<supports-screens
android:resizeable="true"
android:smallScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:normalScreens="true"
android:anyDensity="true"
/>
- 2,361
- 1
- 16
- 31