How to exclude device sizes less than 5 inch in the android manifest

835 views Asked by At

I want my app to install only on devices with screen size >= 5 inches. I don't mind what the resolution is (HD,FHD,QHD,WVGA etc). I also don't mind whether it is a tablet either, but the device size should be greater than or equal to 5 inches. How do I induce such behaviour in my Android Manifest?

Regards.

3

There are 3 answers

0
Bradley Wilson On

You can use the syntax in your <manifest/> tax inside the androidmanifest.xml file. Example syntax provided by Android Developers shows:

<supports-screens android:resizeable=["true"| "false"]
                  android:smallScreens=["true" | "false"]
                  android:normalScreens=["true" | "false"]
                  android:largeScreens=["true" | "false"]
                  android:xlargeScreens=["true" | "false"]
                  android:anyDensity=["true" | "false"]
                  android:requiresSmallestWidthDp="integer"
                  android:compatibleWidthLimitDp="integer"
                  android:largestWidthLimitDp="integer"/>

Further Reading:

  1. Android Developers - Filters on Google Play
  2. How to support different screen size in android
0
ShekharKG On

You can use <supports-screens/> tag before <application/> tag in AndroidManifest.xml file.

Generally 5 inch devices starts with 480dp. So you can set android:requiresSmallestWidthDp="480"

<supports-screens android:smallScreens="false"
          android:normalScreens="false"
          android:largeScreens="true"
          android:xlargeScreens="true"
          android:anyDensity="true"
          android:requiresSmallestWidthDp="480"
          android:compatibleWidthLimitDp="integer"
          android:largestWidthLimitDp="integer"/>

Hope this will help.

0
Rajesh Gosemath On

Read this https://developer.android.com/guide/topics/manifest/compatible-screens-element.html
Read this too : difference between <supports-screens> and <compatible-screens> on Android

<compatible-screens>
    <screen android:screenSize=["small" | "normal" | "large" | "xlarge"]
            android:screenDensity=["ldpi" | "mdpi" | "hdpi" | "xhdpi"
                                   | "280" | "360" | "420" | "480" | "560" ] />
    ...
</compatible-screens>


 Any screen configuration that is not declared in this element is a screen  with 
 which the application is not compatible.Thus, external services (such as Google 
 Play) should not provide the application to devices with such screens.

For screen size >= 5 you should exculde small and normal screen sizes from the manifest.