Android 应用程序与平板电脑不兼容
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10832664/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
App not compatible with tablet
提问by RazorHail
I've build an Android app...for phones...but I wouldn't mind to broaden my audience and let Tablet owners download it as well.... To be honest. it doesn't look very neat on a tablet...but I don't really mind that. I'll at least give them the option.
我已经构建了一个 Android 应用程序......用于手机......但我不介意扩大我的受众并让平板电脑所有者也下载它......老实说。它在平板电脑上看起来不太整洁……但我并不介意。我至少会给他们选择。
unfortunately I cant find the app on the Google Play Store / Android Market with my tablet! when I launch the url directly in the browser, I am being redirected to the Play store, but it says "this app is not compatible with your device"
不幸的是,我无法使用平板电脑在 Google Play 商店/Android Market 上找到该应用程序!当我直接在浏览器中启动 url 时,我被重定向到 Play 商店,但显示“此应用与您的设备不兼容”
I didn't specify anything in my Manifest like "android:xlargeScreens" (the default should be true, right? I also didn't specify any device restrictions in the Store Publish page
我没有在我的 Manifest 中指定任何东西,比如“android:xlargeScreens”(默认应该是 true,对吧?我也没有在 Store Publish 页面中指定任何设备限制
Unfortunately I only have one tablet to test it with...so I don't know if it's the tablets fault, my apps fault or the Play Store's fault....
不幸的是,我只有一台平板电脑来测试它……所以我不知道是平板电脑的问题,我的应用程序的问题还是 Play 商店的问题……
I have an HP Touchpad (CM9)....it's rather experimental device - but other phone apps works without a problem on that device
我有一个 HP Touchpad (CM9)....它是相当实验性的设备 - 但其他手机应用程序在该设备上运行没有问题
while developing, I also used my tablet as a test device, and the app launched on it. so I don't really know why the Play Store is forbidding me to download the app....
在开发过程中,我还使用平板电脑作为测试设备,并在其上启动了应用程序。所以我真的不知道为什么 Play 商店禁止我下载该应用程序....
are there any special requirement that my Manifest or my XML-layouts have to match, for the Play Store to open it for tablet users as well?
我的清单或我的 XML 布局是否有任何特殊要求必须匹配,以便 Play 商店也为平板电脑用户打开它?
采纳答案by RazorHail
I solved my own problem:
我解决了我自己的问题:
I did 2 things:
我做了两件事:
1 - I disabled 'touchscreen'
1 - 我禁用了“触摸屏”
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
this disables ADVANCE touchscreen controls (like flicking etc.)
这将禁用 ADVANCE 触摸屏控件(如轻弹等)
but I think the thing that did it was the following:
但我认为这样做的事情如下:
2 - I disabled the Copy Protection in the Play Store Publish page a few hours later I could find my app on my tablet and install it!
2 - 几个小时后,我在 Play 商店发布页面中禁用了复制保护,我可以在平板电脑上找到我的应用程序并安装它!
回答by Danail
The tablet may not support some of the features that your app requires. You can make them "not required" for the app (that means that you should check if they are actually available before using them in the code).
平板电脑可能不支持您的应用程序所需的某些功能。您可以将它们设置为应用程序“不需要”(这意味着您应该在代码中使用它们之前检查它们是否实际可用)。
It is done like that:
它是这样完成的:
<!-- features -->
<uses-feature android:name="android.hardware.telephony" android:required="false" />
Other possible features are:
其他可能的功能是:
android.hardware.camera
android.hardware.camera.autofocus
android.hardware.location.gps
android.hardware.location
android.hardware.location.network
android.hardware.camera
android.hardware.camera.autofocus
android.hardware.location.gps
android.hardware.location
android.hardware.location.network
For full list of relations between features<->permissions, you can see:
有关功能<->权限之间关系的完整列表,您可以看到:
http://developer.android.com/guide/topics/manifest/uses-feature-element.html
http://developer.android.com/guide/topics/manifest/uses-feature-element.html
See "Feature reference"
请参阅“功能参考”
回答by Dipak Keshariya
write below code into your android manifest.xml file for make application tablet compatible.
将以下代码写入您的 android manifest.xml 文件,以使应用程序平板电脑兼容。
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
回答by Sachin Shelke
Android documentation clearly mentioned that if your app supporting v3.1+ then you should have tag in AndroidManifest.xml
Android 文档清楚地提到,如果您的应用支持 v3.1+,那么您应该在 AndroidManifest.xml 中有标签
http://developer.android.com/guide/practices/screen-compat-mode.html
http://developer.android.com/guide/practices/screen-compat-mode.html