I have an Android application and I want to stop this app installing in Tablet. I have searched many websites. I got some ideas and followed that. But that is not restricting.
Here are the some of sites that i have visited.
Android Manifest Restrict To Tablets
http://android-developers.blogspot.in/2011/09/preparing-for-handsets.html
I have tried with supports-screens
still app is installing in Tablet. How to do this?
Note: My app having minsdkversion = 8 and targetsdkversion = 17
EDIT 1: I have used the following code to find the screen size
xlarge screens are at least 960dp x 720dp
large screens are at least 640dp x 480dp
normal screens are at least 470dp x 320dp
small screens are at least 426dp x 320dp
WindowManager wm=getWindowManager();
DisplayMetrics dm=new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(dm);
deviceWidth=dm.widthPixels;
deviceHeight=dm.heightPixels;
if((deviceHeight< 640 && deviceWidth<480)|| (deviceHeight<480 && deviceWidth< 640))
{
//large screen - TABLET
}
But i don't know where to put this code to restricts installation and what will be the code to stop installation if large screen is true
.
EDIT2: Target device in iOS will be IPAD/IPHONE/UNIVERSAl, like that I want to set in Android app