8

I have designed my app for Android Tablet. But it should be installed only on Android Tablet. For this I have tried the following.

  1. supports-screens
  2. android.hardware.telephony
  3. compatiblity-screens
  4. android.permission.CALL_PHONE

But all the above scenarios are failed. The android app installed both Google Nexus S 4.1.0 mobile and Acer Iconia A500 tablet. Is there any other way to restrict the android app only for android tablet alone.?

Community
  • 1
  • 1
Karthick
  • 1,241
  • 5
  • 20
  • 43

3 Answers3

7

According to documentation these lines would work for you!

<manifest ... >
    <supports-screens android:smallScreens="false"
                      android:normalScreens="false"
                      android:largeScreens="true"
                      android:xlargeScreens="true"
                      android:requiresSmallestWidthDp="600" />
    ...
    <application ... >
        ...
    </application>
</manifest>

The filtering is applied on the market application! That means that you cannot really test it via installing the app from adb or just running it from the apk! APKs that may be filtered by Google Play still can be compatible and can installed on devices from "unknown sources".

You can see the how the filtering is applied when you upload your APK at Market see All Applications > select your application > APK > Supported devices | Excluded devices

  • Excluded devices: will let you manually exclude specific devises.
madlymad
  • 6,367
  • 6
  • 37
  • 68
4

How do you install the APK? Via ADB/Sdcard or GooglePlayStore?

You should be noticed that all the filter is for the market. It cannot prevent user to install the APK manually.

Robin
  • 10,052
  • 6
  • 31
  • 52
  • Running the app via eclipse. So, using adb. – Karthick Apr 09 '13 at 07:10
  • 1
    So you cannot control this. Here is an ugly workaround for you - check the scree size during initialization and display error messages if necessary. However, a better solution is to design a UI suitable for both type of devices. – Robin Apr 09 '13 at 07:12
  • Thanks for you response. But the android developer website "http://developer.android.com/guide/practices/screens-distribution.html#FilteringTabletApps" itself they specify, we can declare app only for tablets. Is this also not a correct way? Am i correct? – Karthick Apr 09 '13 at 07:20
  • Please be noticed that the distribution filter is only working for application distribution via Google play store. For example, if you wrote an app with only l-dpi resource in drawable-ldpi and no resource in default folder "drawable", you can still install in on an HDPI device which will only end with app crash when you tried to refer to any drawable resources. – Robin Apr 09 '13 at 07:33
  • @Robin..Thanks for the reponse. Now, I understood that the filtering only applicable in Google PlayStore not for the app run/push into the devices using the adb install.. – Karthick Apr 09 '13 at 08:47
2

Filtering is done by Google Play, not the device. If you want to restrict app usage just check parameters of the device your app is running on, like screen resolution or certain features you require and either proceed or show error message and just quit.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141