Reputation: 1861
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.
Upvotes: 1
Views: 886
Reputation: 1872
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.
Upvotes: 2
Reputation: 695
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.
Upvotes: 0
Reputation: 1197
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:
Upvotes: 0