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
App installation. Otherwise, select a child organizational unit. Uncheck the Allow users to install apps box. When unchecked, users can't access the App Store and apps bought on other devices can't download automatically. Users can still download allowed apps through the Google Device Policy app.
We can install the android app in two ways.
Using the adb install command, No one can restrict the app installation only to tablets or phone. The , and so on in the manifest settings file is only applicable for the Google Play store filter. We can restrict the app installation to certain device by when you upload your APK at Market see All Applications > select your application > APK > Supported devices | Excluded devices.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With