1

How do i only allow the app to be downloaded for smartphones and exclude all tablet devices?

What i currently have is the following in my manifest:

    <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" />

// EDIT I know have most of the phones in the list. But i am missing nexus 6 for example, while the note 4 is supported. also the nexus 7 is supported this is not ideal in my case.

sn0ep
  • 3,843
  • 8
  • 39
  • 63

2 Answers2

2

The Android Developers website is outdated. It only shows to xhdpi while we already have xxhdpi. This is what I used to support all phones and exclude the tablets:

<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>

I found it here.

I used this for my app like a month ago.

To also add the nexus 6 add these lines:

<screen android:screenSize="normal" android:screenDensity="560" />
<screen android:screenSize="small" android:screenDensity="560" />

See the comments below for more information.

Community
  • 1
  • 1
Kevin van Mierlo
  • 9,554
  • 5
  • 44
  • 76
  • Thanks for your answer it does most of the job correctly. But i notice for example that the Nexus 6 is not supported in this configuration – sn0ep May 26 '15 at 15:51
  • @Toby that's because the Nexus 6 has a screen size of 6" so it doesn't belong to the normal screenSize anymore. If you want to add the Nexus 6 to the list you also have to provide `screenSize="large"` which supports to roughly 7". Also add all the densities again. – Kevin van Mierlo May 26 '15 at 15:55
  • When doing this i only add 7" tablets but the nexus 6 is still excluded. – sn0ep May 26 '15 at 16:04
  • Seems like the Nexus 6 is a special case. Here is a website with specifications http://android-developers.blogspot.nl/2014/10/getting-your-apps-ready-for-nexus-6-and.html?m=1 you need to add another supported screen and choose xxxhdpi and the corresponding density. I'm on my phone right now, so I can't do much from here. If you need extra help you can ask and I'll answer when I get on the computer – Kevin van Mierlo May 26 '15 at 16:21
  • hi kevin, based on the link you posted a i added the following lines: , . Now all 7 inches are gone and the nexus 6 is added ! thanks alot!! – sn0ep May 26 '15 at 16:26
  • @Toby no problem, glad you solved it ;). I'll edit my answer to add the nexus 6 – Kevin van Mierlo May 26 '15 at 18:02
0

You want to use the Compatible Screens element in your Manifest.

http://developer.android.com/guide/topics/manifest/compatible-screens-element.html

This allows your to specify for various screen sizes and resolutions any restrictions.

There is also a guide available from Google here: http://developer.android.com/guide/practices/screens_support.html#range

Oliver Hemsted
  • 571
  • 2
  • 13