限制在片中的应用程序安装应用程序、在片中

由网友(做个废柴继续可爱)分享简介:我有一个Android应用程序,我想为停止这个程序,安装在平板。我已经搜查了许多网站。我有一些想法和遵循的。但是,这并不是限制。I have an Android application and I want to stop this app installing in Tablet. I have searched...

我有一个Android应用程序,我想为停止这个程序,安装在平板。我已经搜查了许多网站。我有一些想法和遵循的。但是,这并不是限制。

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清单限制到片

HTTP://android-developers.blogspot 。在/ 2011/09 / preparing换handsets.html

我曾尝试与支持屏还是应用程序是安装在平板电脑。如何做到这一点?

I have tried with supports-screens still app is installing in Tablet. How to do this?

注意:有我的应用程序的minSdkVersion = 8,targetsdkversion = 17

修改1:我用下面的code找到屏幕尺寸

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

  }

但我不知道在哪里把这个code,以限制安装,什么将是code停止安装,如果大屏幕是真的

EDIT2:在iOS的目标设备将IPAD / IPHONE /通用一样,我想在Android应用程序设置

推荐答案

我们可以通过两种方式安装Android应用程序。

We can install the android app in two ways.

在ADB install命令 从谷歌Play商店

使用ADB安装命令,没有人可以限制应用程序只能安装到平板电脑或手机。的,因此在该清单设置文件只适用于谷歌Play商店的过滤器。我们可以限制应用程序安装到特定的设备,当您上传您的APK在市场被看到所有应用程序>选择您的应用程序> APK>支持的设备|排除设备。

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.

阅读全文

相关推荐

最新文章