Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android "Support Screens" doesn't work?

I built one app, and I'm trying to exclude devices with a small screen. To do this I exploited the Support Screen Element in the manifest.

<supports-screens
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="false"
    android:xlargeScreens="true"
    android:requiresSmallestWidthDp="320" />

As the link to the developer page says: For example, a typical handset screen has a smallestWidth of 320dp.

Some day ago I noticed people with small devices are still giving bad reviews because they can still download the app and some of the layout elements doesn't appear in the screen. Of course, one solution would be to adapt the layout, but please at the moment my question is another.

It seems the android:requiresSmallestWidthDp attribute is not working. In fact I tried to set it to 700 or higher, just to make an experiment, and loading it to the store, the number of supported devices doesn't change!

I also change the minor version of the SDK to 13 to prevent compatibility issue with that attribute:

<uses-sdk
    android:minSdkVersion="13"
    android:targetSdkVersion="19" />

The other attributes work well, for example if I remove normal screens, the number of supported devices drops down.

I would like to remove devices with a dpi lower the 320, but I cant. And I can't understand what am I doing wrong.

Update

There is this sentence: Google Play currently does not support this attribute for filtering (on Android 3.2) so you should continue using the other size attributes if your application does not support small screens. But:

  • It is not clear to me what happens to Android 3.2+ versions. If I put Android version 13+ on my manifest and the android:requiresSmallestWidthDp attribute people can still install the app, and then?
  • The other size attributes are: android:compatibleWidthLimitDp, and android:largestWidthLimitDp. but both they consider the maximum "smallest width" instead of the minimum width which is what I need.

So my question is, how can prevent people with screen smallest than 500 pixel, or 360 dpi to install my app? Can I?

like image 567
donnadulcinea Avatar asked Dec 28 '14 07:12

donnadulcinea


1 Answers

From the official source

Caution: The Android system does not pay attention to this attribute, so it does not affect how your application behaves at runtime. Instead, it is used to enable filtering for your application on services such as Google Play. However, Google Play currently does not support this attribute for filtering (on Android 3.2), so you should continue using the other size attributes if your application does not support small screens.

Update:

Looks like android:requiresSmallestWidthDp is not used at filtering at Google Play at all. Only android:smallScreens, android:normalScreens, android:largeScreens and android:xlargeScreens apply on it.

I did next tests:


<supports-screens
    android:smallScreens="false"
    android:normalScreens="true"
    android:largeScreens="true"
    android:xlargeScreens="true"/>

or

<supports-screens
    android:smallScreens="false"
    android:normalScreens="true"
    android:largeScreens="true"
    android:xlargeScreens="true"
    android:requiresSmallestWidthDp="360"/>

enter image description here

<supports-screens
    android:smallScreens="true"
    android:normalScreens="true"
    android:largeScreens="true"
    android:xlargeScreens="true"/>

or

<supports-screens
    android:smallScreens="true"
    android:normalScreens="true"
    android:largeScreens="true"
    android:xlargeScreens="true"
    android:requiresSmallestWidthDp="360"/>

enter image description here

65 devices were added only


You can try to play around with <compatible-screens>

DESCRIPTION:

Specifies each screen configuration with which the application is compatible. Only one instance of the element is allowed in the manifest, but it can contain multiple elements. Each element specifies a specific screen size-density combination with which the application is compatible.

The Android system does not read the manifest element (neither at install-time nor at runtime). This element is informational only and may be used by external services (such as Google Play) to better understand the application's compatibility with specific screen configurations and enable filtering for users. Any screen configuration that is not declared in this element is a screen with which the application is not compatible. Thus, external services (such as Google Play) should not provide the application to devices with such screens.

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 specific screen configurations. Instead of using this element, you should follow the guide to Supporting Multiple Screens to provide scalable support for multiple screens using alternative layouts and bitmaps for different screen sizes and densities.

like image 200
gio Avatar answered Sep 29 '22 11:09

gio