Android: Disable to install app on tablets(Android:禁止在平板电脑上安装应用)
问题描述
我正在开发只能安装在手机而不是平板电脑上的应用.
I'm working on app that should be installed only on phones and not tablets.
我想问,如何限制只能安装在手机上?
I want to ask, how can I restrict to install only on phones?
我正在阅读这篇文章,但对我来说似乎很老:分发到特定屏幕
I was reading this article, but it seems pretty old to me: Distributing to Specific Screens
他们根本不是在谈论 xxhdpi 或 xxxhdpi 分辨率,设备是按屏幕大小划分的.几年前它可以工作,但现在呢?例如,Nexus 6 的屏幕尺寸为 6 英寸 - 它几乎可以被视为平板电脑.
They are not talking about xxhdpi or xxxhdpi resolutions at all and devices are divided by screen size. It could work few years ago, but now? For example Nexus 6 has 6" screen size - it can be considered almost like tablet.
您知道任何可行的解决方案吗?
Do you know any working solution?
推荐答案
如果我们使用 adb install 命令来安装应用程序,则无法将应用程序安装限制为仅在平板电脑或手机上.此外,如果我们在清单中提供标签,它仅适用于 Google Play 商店过滤器,要检查这一点,您可以尝试以下代码,将其放入清单中并尝试将其安装在 7 英寸平板电脑中,它会允许,
To install app if we are using adb install command , it's not possible to restict app installation only to tablets or phones. Also if we give tag in menifest it's only applicable for the Google Play store filter, to check this you can try following code, put it into your menifest and try to install it in 7 inch tablet, it will allow,
<supports-screens
android:largeScreens="false"
android:largestWidthLimitDp="600"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="false" />
通过使用此代码,Google Play 商店仅在安装时过滤和限制,但在其他情况下不作为共享 apk 或在模拟器中安装.
By using this code Google play store filters and restrict while installing only, but not in other cases as sharing apk, or installing in emulator.
因此,当您在市场上上传 APK 时,要将应用安装限制在特定设备上,您需要这样做应用程序->选择您的应用程序->APK-> 支持的设备 |排除的设备
So, to restrict the app installation to certain device when you upload APK at market , you need to do this Applications->select your application->APK-> Supported devices | Excluded devices
这篇关于Android:禁止在平板电脑上安装应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android:禁止在平板电脑上安装应用
基础教程推荐
- AdMob 广告未在模拟器中显示 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iOS4 创建后台定时器 2022-01-01
