Reputation: 11453
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>
Upvotes: 3
Views: 5076
Reputation: 5113
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" />
Upvotes: 0
Reputation: 39406
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.
Upvotes: 2
Reputation: 589
@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
Upvotes: 0
Reputation: 660
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" />
Upvotes: 7