3

I want to upload an application, which should be available for smartphones only (app needs functionality to start calls, so I want to exclude tablets...)

I read Googles Supporting Multiple Screens and compatible-screens. I found the supported-screens, but the android:largestWidthLimitDp attribute is available in 'API13' and I'm starting with 'API10'.

There are newer devices (Xperia Z, Galaxy S4 and HTC One) which use drawable-xxhdpi graphics and have a screen-resolution which is like a tablet.

Question: Is this manifest-declaration right for targeting only smartphones including the new smartphones?

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

    <!-- support for Xperia Z, Galaxy S4 and HTC One -->
    <screen android:screenDensity="480" android:screenSize="normal" /> 
    <screen android:screenDensity="480" android:screenSize="large" /> 
</compatible-screens>
longi
  • 11,104
  • 10
  • 55
  • 89
  • According to http://developer.android.com/guide/practices/screens-distribution.html#FilteringHansetApps that is the way to do it. It'll support small, medium, and large screens of all densities, but won't support the extra large (tablet) screens. – Bill Gary Oct 24 '13 at 13:25
  • please note that `makes calls` and `phone` are 2 sets of objects, quite close, but not identical. Some non-phonish devices are capable of making calls. – njzk2 Oct 24 '13 at 13:36

4 Answers4

7

If your app needs the ability to start phone calls. Why not filter on the telephony feature?

<uses-feature android:name="android.hardware.telephony" android:required="true" />
pocmo
  • 660
  • 6
  • 24
  • 1
    What happens if tablet has LTE or can do call like Asus Phonepad? – JJ86 Oct 24 '13 at 13:29
  • 1
    `app needs functionality to start calls`, which the SO has for some reason interpreted as `phone only`. I think any tablet that can make call should be able to use an app that needs to make call. – njzk2 Oct 24 '13 at 13:34
  • @pocmo: Thanks for that! Is it possible to ONLY use your recommendation and remove the 'compatible-screens' at all? (so, app is for every device which can make calls?!) – longi Oct 24 '13 at 14:33
2

According to the <uses-feature> http://developer.android.com/guide/topics/manifest/uses-feature-element.html documentation, the simple fact of having the CALL_PHONE permission (which you have if you are making calls) implies the android.hardware.telephony requirement, which effectively filters out any non-telephony-capable device.

On the other hand, restricting on screen size/density may exclude non-existing devices, requiring that you update your app every now and then. I wouldn't recommend that.

njzk2
  • 38,969
  • 7
  • 69
  • 107
0

@pocmo is right but you also should add

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

to your manifest file. android:largeScreens="false" and xlargeScreens="false" will remove tablets 7" and 10" from the list

Eddy
  • 489
  • 4
  • 10
0

Take a look at this official link at Declaring app is only for handsets:

<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>
    ...
    <application ... >
        ...
    <application>
</manifest>

EDIT

Try to add:

<screen android:screenSize="normal" android:screenDensity="xxhdpi" />

or

<screen android:screenDensity="480" android:screenSize="normal" />
JJ86
  • 5,055
  • 2
  • 35
  • 64
  • but this doesn't select any `xxhdpi`-devices, does it? check here: http://stackoverflow.com/questions/16500309/any-way-to-support-samsung-galaxy-s4-using-compatible-screen-sizes – longi Oct 24 '13 at 14:36
  • @longilong try to add "" or "" . – JJ86 Oct 24 '13 at 14:52