Question

I developed an application. And now i want that my application should run only on mobiles not on tablets. I searched for that and tried as:

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

I write this in androidmenifest.xml file. But it is of no use. My application is running on tablet now also.

Am i declared is wrong, or i should include anything else.

Please suggest what should i do to restrict my application from running on tablet.

Was it helpful?

Solution 2

Why do you want it to only run on non-tablets? Is there a feature (like SMS) you need? If so, add a uses-feature tag in your manifest. If its based on screen size, why not just scale up and get more users?

Also, screen size means nothing for phone vs tablet. My phone is a Note 2, it has more pixels than original generation tablets. You could disable all the devices you don't want on the play store, but it would be a pain.

OTHER TIPS

I think the best way to do this is use:

<uses-feature android:name="android.hardware.telephony" />

This way you assure the device doesn't have phone support, what is the case on all the tablets I know.

support screens won't restrict an application downloaded from google play, If you want to restrict, just use compatible screens

<compatible-screens>
<screen android:screenSize=["small" | "normal" | "large" | "xlarge"]
        android:screenDensity=["ldpi" | "mdpi" | "hdpi" | "xhdpi"] />
...
</compatible-screens>

read this

Support Screen will effect after you will upload your apk file to Google playstore, untill you will not get this feature affected.

Also see the Filters on Google Play document for more information.

Have a look at this answer on how to check for SMS (or telephony) functionality. Of course, the most appropriate solution is to filter on Google Play. But if you miss something and want to check during run time, I think this would help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top