Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restrict app installing in Tablets

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

like image 822
Ponmalar Avatar asked Feb 13 '13 04:02

Ponmalar


People also ask

How do I restrict an app installation?

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.


1 Answers

We can install the android app in two ways.

  1. adb install command
  2. From Google Play store

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.

like image 118
Karthick Avatar answered Oct 01 '22 08:10

Karthick