user3387633
user3387633

Reputation: 121

Restricting screen compatibility on Android

The proper way of restricting the installation of an Android app to handheld devices should be to use the compatible-screen element in your manifest (https://developer.android.com/guide/topics/manifest/compatible-screens-element.html).

This, however, does not actually work (or not anymore ?).

If my understanding of this documentation is correct, then Google Play should declare my application incompatible with any tablet devices:

<compatible-screen>
    <screen android:screenDensity="ldpi" android:screenSize="small" />
    <screen android:screenDensity="mdpi" android:screenSize="small" />
    <screen android:screenDensity="hdpi" android:screenSize="small" />
    <screen android:screenDensity="xhdpi" android:screenSize="small" />
</compatible-screen>

Yet this is not what happens. After an update, and several days of waiting, Google Play keeps declaring the application as compatible with all my devices (tablets included).

Is there a misunderstanding, or is the documentation not up to date ?

Upvotes: 1

Views: 69

Answers (1)

Machado
Machado

Reputation: 14489

Are you declaring it as a direct child of the <manifest> element in AndroidManifest.xml?

<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" />
    <screen android:screenSize="small" android:screenDensity="480" />
    <screen android:screenSize="small" android:screenDensity="640" />

    <!-- 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" />
    <screen android:screenSize="normal" android:screenDensity="480" />
    <screen android:screenSize="normal" android:screenDensity="640" />
</compatible-screens>

Don't forget to add xxhdpi and xxxhdpi.

Upvotes: 2

Related Questions