0

I'm trying to make a build for a Google Cardboard project and I want to stop the app being downloaded on Android tablets.

I've added the code below in my manifest yet there still seems to be about 1900 devices available.

Any thoughts on why this is?

Thanks,

(Had to remove the brackets around the text)

<supports-screens android:largeScreens="false" android:largestWidthLimitDp="540" android:normalScreens="true" android:requiresSmallestWidthDp="360" android:smallScreens="false" android:xlargeScreens="false"/>
Bushes
  • 1,010
  • 1
  • 18
  • 37

3 Answers3

1

You can find how to support only handsets
https://developer.android.com/guide/practices/screens-distribution.html#FilteringHansetApps
Or you can start from here (supports only tablets)
https://developer.android.com/guide/practices/screens-distribution.html#FilteringTabletApps and modify it in this way

<manifest ... >
    <supports-screens android:smallScreens="true"
                      android:normalScreens="true"
                      android:largeScreens="false"
                      android:xlargeScreens="false"
                      android:largestWidthLimitDp="600" />
    ...
    <application ... >
        ...
    </application>
</manifest>
Rino
  • 733
  • 8
  • 19
0

You should add this to your manifest :

<compatible-screens>
    <!-- all small size screens -->
    <screen android:screenSize="small" android:screenDensity="ldpi" />
    <screen android:screenSize="small" android:screenDensity="mdpi" />
    <screen android:screenSize="small" android:screenDensity="hdpi" />
    <screen android:screenSize="small" android:screenDensity="xhdpi" />
    <!-- all normal size screens -->
    <screen android:screenSize="normal" android:screenDensity="ldpi" />
    <screen android:screenSize="normal" android:screenDensity="mdpi" />
    <screen android:screenSize="normal" android:screenDensity="hdpi" />
    <screen android:screenSize="normal" android:screenDensity="xhdpi" />
</compatible-screens>

This should restrict the app to phones only. But use with caution, as there is more and more devices using the xxhdpi or even xxxhdpi screen density, so using this, you might block your app on some high end phones too.

More infos : Android: Disable application for tablet

Community
  • 1
  • 1
YumeYume
  • 981
  • 2
  • 12
  • 33
0

Unfortunately there's not a really good way of removing tablets. I ended up just turning those devices off directly in the developer console.

For disabling screen sizes in the manifest you need to use this

<compatible-screens>
   <!-- all small size screens -->
        <screen android:screenSize="small" android:screenDensity="ldpi" />
        <screen android:screenSize="small" android:screenDensity="mdpi" />
        <screen android:screenSize="small" android:screenDensity="hdpi" />
        <screen android:screenSize="small" android:screenDensity="xhdpi" />
        <!-- all normal size screens -->
        <screen android:screenSize="normal" android:screenDensity="ldpi" />
        <screen android:screenSize="normal" android:screenDensity="mdpi" />
        <screen android:screenSize="normal" android:screenDensity="hdpi" />
        <screen android:screenSize="normal" android:screenDensity="xhdpi" />
    </compatible-screens>

instead of what you have listed. The problem is this will also remove large phones, however in the case of google cardboard that might be ok since some of those phones won't fit in cardboard anyway.

Ben
  • 1,285
  • 1
  • 9
  • 15