Search code examples
androidresourcesdimension

how to define dimens for multiResolution in android studio


I use Android Studio version 1.2.2

i want to build App in MultiResolution So i used dimens.xml for some resolutions, but it not works well and always show mdpi resources

dimens.xml

In AndroidManifest.xml i put :

    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"
        android:anyDensity="true"
        android:resizeable="true"/>

there is dimens.xml for Four Resolutions, Tested on Samsung Galaxy Tab2 10.1" (Density 4), But not works well So whats wrong on this project ?

Solved, dimens.xml should set to whole resolutions as

dimens.xml

Density programmatically shows 4, but in xml should set values for sw720dp.


Solution

  • But for that you should add

    <supports-screens 
      android:smallScreens="true"
      android:normalScreens="true"
      android:largeScreens="true"
      android:xlargeScreens="true"
      android:anyDensity="true"
      android:resizeable="true"/>
    

    in your manifest.xml

    Check this article multiple-screen-support-in-android-using-android-studio