Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Manifest Restrict To Tablets

For business reasons I'd like to restrict my Android application strictly to tablet devices.

At the moment, I can limit the app to Honeycomb devices by setting:

android:minSdkVersion="11" 

But the next version of Android (Ice Cream Sandwich) will have a higher version number for both the tablet and phone versions of the OS.

Is there any manifest attribute I can specify to restrict it to tablet devices? (Honeycomb or any later tablet version)

like image 456
Daniel Delaney Avatar asked Oct 04 '11 14:10

Daniel Delaney


People also ask

What is Android manifest permission?

The Android manifest file helps to declare the permissions that an app must have to access data from other apps. The Android manifest file also specifies the app's package name that helps the Android SDK while building the app.

How do I make Android apps compatible with my tablet?

If feature is not supported in tablet but is declared in manifest file without explicitly declaring as android:required="false" , then that tablet will be filtered out from Google Play. Show activity on this post. Add below code into your android manifest. xml file for make application tablet compatible.


2 Answers

You will find this link awesome: http://android-developers.blogspot.com/2011/09/preparing-for-handsets.html

The problem with what we call "tablet" is that the definition is not the same for evryone. I think about the Archos 5IT that is the same size than a phone but branded with "tablet" name. Same issue with Dell Streak.

I would personnaly not call that a tablet..

So if you want to restrict to 7 or 5 inches devices, you should use xlargeScreens and largeScreens.

(There is also a bug in HTC flyer - 7 inches- that uses largeScreens, blame HTC)

I guess that playing with Screen size in Manifest will fit your needs:

<supports-screens android:smallScreens="false"                   android:normalScreens="false"                   android:largeScreens="false"                   android:xlargeScreens="true"                   android:anyDensity="true"                   android:requiresSmallestWidthDp="600"                   android:compatibleWidthLimitDp="integer"                   android:largestWidthLimitDp="integer"/> 

enter image description here

like image 150
Waza_Be Avatar answered Oct 19 '22 23:10

Waza_Be


              android:requiresSmallestWidthDp="600"               android:compatibleWidthLimitDp="integer"               android:largestWidthLimitDp="integer" 

Be careful, Android Market currently does not support this attribute for filtering (from the official guide).

use support screen large and xlarge and now you have two options:

  • exclude the large screen devices which are not tablets manually from Market(+500...)

  • You can measure programmatically the width and if it width<600 say the user that the app is not compatible.

While that we'll have to wait for the Market to filter by android:requiresSmallestWidthDp="600" ...

like image 20
AntPachon Avatar answered Oct 20 '22 01:10

AntPachon