0

I am a beginner in android and going to finish my first android app. I want my app to be downloadable only on mobile handsets and not on tablets. Is there any way to do that? Please help.

  • 2
    Possible duplicate of [How to restrict app to Android phones only](https://stackoverflow.com/questions/25230554/how-to-restrict-app-to-android-phones-only) – Martin Zeitler Sep 06 '18 at 19:10

2 Answers2

1

Because the system generally scales applications to fit larger screens well, you shouldn't need to filter your application from larger screens. As long as you follow the Best Practices for Screen Independence, your application should work well on larger screens such as tablets. However, you might discover that your application can't scale up well or perhaps you've decided to publish two versions of your application for different screen configurations. In such a case, you can use the  element to manage the distribution of your application based on combinations of screen size and density. External services such as Google Play use this information to apply to filter to your application so that only devices that have a screen configuration with which you declare compatibility can download your application.

Bear in mind that <compatible-screens> requires you to whitelist every screen size and densitythat you are supporting (and we get a new density every year or so), and you are limited to the classic screen size buckets (small, normal, large, xlarge). The documentation's sample is missing some densities:
<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>
You will need to add additional elements if are willing to support tvdpi, xxhdpi, and xxxhdpidevices.
Vishal Sharma
  • 1,051
  • 2
  • 8
  • 15
0

Yes. you can do it. Please check the documentation to understand various ways of doing it

https://developer.android.com/guide/practices/screens-distribution

I would suggest to use screen support in 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>
Viswanath Kumar Sandu
  • 2,230
  • 2
  • 17
  • 34