I have question, how i can make application which can support all densities and resolutions screens?
Asked
Active
Viewed 261 times
-4
-
Read the Android tutorial [`Supporting Multiple Screens`](http://jayxie.com/mirrors/android-sdk/guide/practices/screens_support.html) and also [`Designing UI for Multiple Screens`](http://developer.android.com/training/multiscreen/index.html) – Ram kiran Pachigolla Sep 10 '12 at 08:36
-
Please read [this](http://developer.android.com/guide/practices/screens_support.html), it should answer this question pretty satisfactory. – slezadav Sep 10 '12 at 08:33
1 Answers
1
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 screens .
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />

Chirag
- 56,621
- 29
- 151
- 198
-
Sorry my bad... for stupid question, actually i try to say It possible programmically find out the divice screen size and dp and then load the best resources and fit layout? – user1582087 Sep 10 '12 at 12:17
-
Thanks, now i know how to get the dimmensions, but how to set resources folder for each dimmension? – user1582087 Sep 10 '12 at 12:36
-
@user1582087 . Check this code......................... DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); res = dm.heightPixels; if(res > 800) { setContentView(R.layout.main854); } else { setContentView(R.layout.main); } – Chirag Sep 10 '12 at 12:37
-
Maybe i can load for example all folder with resource, but not just one file? – user1582087 Sep 11 '12 at 06:50