How to limit Android tablet app?

I want my application to run only on a mobile device, not in

10 and 7 inch tablet

. but my application runs on both tablet sizes .please help me

+5
source share
5 answers

Yes, as @OceanLife says you should go with compatible-screens or supports-screens .

but I would like to add something here.

if you use

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

then pay attention to the official compatible-screens documentation:

, xlarge , , . (, Google Play)  .  , ,   .

, , apk PlayStore. .

. Google Play , Google Play , .

, .

+9

google , , , :

.

:

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

:

, (, ), .

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

Android.

    <uses-sdk
android:minSdkVersion="6"
android:targetSdkVersion="8" />


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

:

You should use this attributein your mainfest android: largeWidthLimitDp = "enter the value of the mobile pixel that you want to limit."

 <supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:resizeable="true"
    android:largestWidthLimitDp="500"
    android:smallScreens="true"
    android:xlargeScreens="false" />
+1
source

Using the Uses-Feature , you can limit the distribution of the application only to the tablets and tablets-like devices Landscaping screens. Here is the code you will need in your manifest.xml:

          <uses-feature android:name="android.hardware.screen.landscape"
                      android:required="true"
          ></uses-feature>

Also use:

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

All Articles