I am publishing my app in the Play store and i don\'t want it to be available for tablets. How can i make it happen?
I don\'t want to manually exclude every single
Use Support screen tag in manifest file is wrong method. Alway use <compatible-screens>
to make your app not available to tablet.
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="false"
android:xlargeScreens="false"
android:resizeable="false" />
Caution
If you use the element for the above scenario (when your application is not compatible with larger screens) and set the larger screen size attributes to "false", then external services such as Google Play do not apply filtering. Your application will still be available to larger screens, but when it runs, it will not resize to fit the screen. Instead, the system will emulate a handset screen size (about 320dp x 480dp; see Screen Compatibility Mode for more information). If you want to prevent your application from being downloaded on larger screens, use as suggested by @CommonsWare.
Use tag for exclude your app to run on tablet.
<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>
http://developer.android.com/guide/practices/screens-distribution.html#FilteringHansetApps
...you can use the element to manage the distribution of your application based on combinations of screen size and density. External services such as Google Play use this information to apply filtering to your application, so that only devices that have a screen configuration with which you declare compatibility can download your application.
The sample <compatible-screens>
element from that page:
<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>
However, I would recommend also adding lines for a density of xxhdpi
, as such devices are shipping now (Droid DNA, Xperia Z, HTC Butterfly, etc.).
UPDATE
First, with respect to your build errors, if you read the documentation for the <compatible-screens> element, you will notice that it was added in API Level 9, and for some strange reason, you build target is set older than that.
Second, with respect to:
i need my app to run on devices that normal people call smartphone and not on devices that normal people call tablets... e.g. it has to run on "Galaxy Note 2" but not on "Galaxy Tab"
This is not possible, simply because you do not have a concrete definition of what you do and do not want your app shipping on.
There are ~8 billion "normal people" on the planet. You are welcome to interview each one of them and ask them what they think the Galaxy Note 2 is. Some will say a phone. Some will say a tablet. Some will say a "phablet", which will not be useful. Some will chase you out of their homes, claiming that you have brought some light-emitting demon into their midst (this too will not be useful, and may be painful if they have stones handy to throw).
If, at some point in time in the future, you come up with a scientific definition of what you do and do not want to ship your device on, ask a fresh StackOverflow question. By "scientific definition", I mean an algorithm that can be universally applied, by all people on all devices, to determine what you do and do not want your app on.
(note that by "all people", I am excluding those who might consider you to be a demon-monger)
For example:
"I want to ship on all devices that have telephony capability, regardless of screen size"
"I want to ship on all devices that have a screen size smaller than such-and-so many inches on its smallest side:
You might try adding a check of some sort for 3g or 4g service. That will exclude most, but probably not all tablets.