2

Possible Duplicate:
prevent tablet downloads of app

if I want that my app runs only on smartphones and not on tablets, are this lines in the manifest enough?

<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" />
    <!-- all large size screens -->
    <screen android:screenSize="large" android:screenDensity="ldpi" />
    <screen android:screenSize="large" android:screenDensity="mdpi" />
    <screen android:screenSize="large" android:screenDensity="hdpi" />
    <screen android:screenSize="large" android:screenDensity="xhdpi" />
</compatible-screens>
Community
  • 1
  • 1
  • I know that there are many tablets that fall under the "large" category. To complicate things, with the upcoming "phablet" phone trend, the "large" bucket may start being filled with a bunch of 5+" phones as well. – DeeV Jan 22 '13 at 13:49

3 Answers3

1

Well, that depends on what you think a "tablet" is.

Your <compatible-screens> element will stop the Play Store from distributing your app to -xlarge devices (10" and larger diagonal screen size). It will not stop the Play Store from distributing your app to -large devices (5" to 10"), which will include many devices that marketers will term "tablets".

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
1

No, it's not enough as there are tablets with large screens (e.g. your app will still work on 7-inch tablets). You cannot prevent somebody downloading your app just defining whether it's a tablet or not because it's quite abstract. Is Galaxy Note a tablet or a phone? Do you want your app to run on it? As you see, you can use this attribute in manifest but you will not get a good control over the device type.

My advice is to define the screen size programmatically and to notify the user that the app is incompatible with this device. Check if the screen type satisfies your conditions - if yes - run the app, if not - show an Activity that unfortunately the screen is not supported. Or adapt your app to support multiple screen sizes.

It is highly discouraged to use this attribute unless you have a good reason to do so:

Caution: Normally, you should not use this manifest element. Using this element can dramatically reduce the potential user base for your application, by not allowing users to install your application if they have a device with a screen configuration that you have not listed. You should use it only as a last resort, when the application absolutely does not work with all screen configurations. Instead of using this element, you should follow the guide to Supporting Multiple Screens, in order to provide complete support for multiple screens, by adding alternative resources for different screen sizes and densities.

Taras Leskiv
  • 1,835
  • 15
  • 33
  • The reason is that I'm still working on the tablet version. The current version of the application looks bad on the tablet. Only this. – user1979646 Jan 22 '13 at 13:59
1

If you are using the Play Store you can choose what devices will be able to download your app there using their own system, when publishing it.

Here is the information you need about this: https://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1286017&ctx=go

Joao Guilherme
  • 387
  • 2
  • 10