Android 为什么我的应用没有显示在 Google Play 的平板电脑上?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11691775/
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
Why my App is not showing up on tablets in Google Play?
提问by Saqib
I just released my app for phones and tablets but it is not showing up in Google Play for tablets.
我刚刚发布了适用于手机和平板电脑的应用程序,但它没有出现在适用于平板电脑的 Google Play 中。
Checked on Nexus 7 and Asus eeeePad
在 Nexus 7 和华硕 eeeePad 上检查
This is what I have in my manifest file
这是我的清单文件中的内容
<compatible-screens>
<!--no small size screens -->
<!--Only hdpi and xhdpi for normal size screens -->
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
<!-- all large size screens -->
<screen android:screenSize="large" android:screenDensity="ldpi" />
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />
<!-- all xlarge size screens -->
<screen android:screenSize="xlarge" android:screenDensity="ldpi" />
<screen android:screenSize="xlarge" android:screenDensity="mdpi" />
<screen android:screenSize="xlarge" android:screenDensity="hdpi" />
<screen android:screenSize="xlarge" android:screenDensity="xhdpi" />
</compatible-screens>
uses-sdk tag
使用-sdk 标签
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11" />
permissions
权限
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<permission android:name="com.myapp.something.permission.C2D_MESSAGE" android:protectionLevel="signature" />
After explicitly adding uses-feature tag to false it started appearing for Asus eeeePad tablet but still not appearing for nexus 7. Here is what I see in developer console
在将 uses-feature 标签显式添加到 false 后,它开始出现在 Asus eeeePad 平板电脑上,但仍然没有出现在 nexus 7 中。这是我在开发者控制台中看到的
This application is only available to devices with these features, as defined in your application manifest.
Screen densities: LARGE,MDPI LARGE,HDPI LARGE,LDPI LARGE,XHDPI XLARGE,MDPI XLARGE,HDPI XLARGE,LDPI XLARGE,XHDPI NORMAL,MDPI NORMAL,HDPI NORMAL,XHDPI
Required device features
此应用程序仅适用于具有应用程序清单中定义的这些功能的设备。屏幕密度:LARGE,MDPI LARGE,HDPI LARGE,LDPI LARGE,XHDPI XLARGE,MDPI XLARGE,HDPI XLARGE,LDPI XLARGE,XHDPI NORMAL,MDPI NORMAL,HDPI NORMAL,XHDPI
所需的设备功能
android.hardware.screen.portrait
android.hardware.touchscreen
回答by Saqib
At last adding a special case for Nexus 7 with in <compatible-screens>
tag worked for me. As Nexus 7 has tvdpi density
最后为 Nexus 7 添加一个带有 in<compatible-screens>
标签的特例对我有用。由于 Nexus 7 具有 tvdpi 密度
<compatible-screens>
<!--no small size screens -->
<!--all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
<!-- all large size screens -->
<screen android:screenSize="large" android:screenDensity="ldpi" />
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />
<!-- all xlarge size screens -->
<screen android:screenSize="xlarge" android:screenDensity="ldpi" />
<screen android:screenSize="xlarge" android:screenDensity="mdpi" />
<screen android:screenSize="xlarge" android:screenDensity="hdpi" />
<screen android:screenSize="xlarge" android:screenDensity="xhdpi" />
<!-- Special case for Nexus 7 -->
<screen android:screenSize="large" android:screenDensity="213" />
</compatible-screens>
UPDATE:
更新:
For xxhdpi devices you can use 480 as an int value
对于 xxhdpi 设备,您可以使用 480 作为 int 值
<screen android:screenSize="normal" android:screenDensity="480" />
<screen android:screenSize="large" android:screenDensity="480" />
<screen android:screenSize="xlarge" android:screenDensity="480" />`
回答by Erol
This pageidentifies your problem.
此页面确定您的问题。
When you use <uses-feature>
instead of <uses-permission>
, your application won't be filtered out by Market but expects you handle devices not supporting that feature on code level.
当您使用<uses-feature>
代替 时<uses-permission>
,您的应用程序不会被市场过滤掉,但希望您处理在代码级别不支持该功能的设备。
For any of the permissions in that page above, you can disable filtering based on the implied feature by explicitly declaring the implied feature explicitly, in a <uses-feature>
element, with an android:required="false"
attribute. For example, to disable any filtering based on the CAMERA permission, you would add this declaration to the manifest file:
对于上述页面中的任何权限,您可以通过在<uses-feature>
元素中使用android:required="false"
属性显式声明隐含功能来禁用基于隐含功能的过滤。例如,要禁用基于 CAMERA 权限的任何过滤,您可以将此声明添加到清单文件中:
<uses-feature android:name="android.hardware.camera" android:required="false" />
However, when you specify <uses-permission>
, all devices who do not have access to that feature are filtered.
但是,当您指定 时<uses-permission>
,将过滤所有无权访问该功能的设备。
回答by ninge
I belive the key is in your permissions. By saying that your app uses RECEIVE_SMS
and READ_PHONE_STATE
Google Play uses that to filter out devices that can't do those things (tablets) because it thinks that your app needs to use those permissions in order to work. According to the android developer site:
我相信关键在于您的权限。通过说您的应用程序使用RECEIVE_SMS
并且READ_PHONE_STATE
Google Play 使用它来过滤掉无法执行这些操作的设备(平板电脑),因为它认为您的应用程序需要使用这些权限才能工作。根据android开发者网站:
"To prevent those apps from being made available unintentionally, Google Play assumes that certain hardware-related permissions indicate that the underlying hardware features are required by default. For instance, applications that use Bluetooth must request the BLUETOOTH permission in a element — for legacy apps, Google Play assumes that the permission declaration means that the underlying android.hardware.bluetooth feature is required by the application and sets up filtering based on that feature."
“为了防止这些应用程序无意中可用,Google Play 假定某些与硬件相关的权限表明默认情况下需要底层硬件功能。例如,使用蓝牙的应用程序必须在元素中请求 BLUETOOTH 权限——对于旧版应用程序,Google Play 假定权限声明意味着应用程序需要底层的 android.hardware.bluetooth 功能,并根据该功能设置过滤。”
Also, look at this:
另外,看看这个:
Telephony CALL_PHONE android.hardware.telephony CALL_PRIVILEGED android.hardware.telephony MODIFY_PHONE_STATE android.hardware.telephony PROCESS_OUTGOING_CALLS android.hardware.telephony READ_SMS android.hardware.telephony RECEIVE_SMS android.hardware.telephony RECEIVE_MMS android.hardware.telephony RECEIVE_WAP_PUSH android.hardware.telephony SEND_SMS android.hardware.telephony WRITE_APN_SETTINGS android.hardware.telephony WRITE_SMS android.hardware.telephony
电话 CALL_PHONE android.hardware.telephony CALL_PRIVILEGED android.hardware.telephony MODIFY_PHONE_STATE android.hardware.telephony PROCESS_OUTGOING_CALLS android.hardware.telephony READ_SMS android.hardware.telephony android.hardware.telephonyMEND_SMS android.hardware.telephony android.hardware.telephony android.hardware.telephony android.hardware.telephony 修改_电话_STATE android.hardware.telephony android.hardware.telephony WRITE_APN_SETTINGS android.hardware.telephony WRITE_SMS android.hardware.telephony
You have RECEIVE_SMS
and READ_PHONE_STATE
so you automatically have android.hardware.telephony
. You can fix this by doing
你有RECEIVE_SMS
,READ_PHONE_STATE
所以你自动拥有android.hardware.telephony
。你可以通过这样做来解决这个问题
<uses-feature android:name="android.hardware.telephony" android:required="false" />
All of this is explained in more depth here.
所有这些都在此处进行了更深入的解释。
回答by banachi
I have to do all three of these things to get it to work for Nexus 7. Once you uploaded your apk, you can verify the setting by first activate the new apk, go to product detail and search for supported devices. If Nexus 7 is not found under "Unsupported devices due to your manifest settings" you are good.
我必须做所有这三件事才能让它在 Nexus 7 上工作。一旦你上传了你的 apk,你可以通过首先激活新的 apk 来验证设置,转到产品详细信息并搜索支持的设备。如果在“由于您的清单设置而不受支持的设备”下找不到 Nexus 7,那么您就很好。
Note: Once you upload your apk, Google Play will translates 213 density to tvdpi. Not sure why is not an option in eclipse manifest tool...
注意:上传 apk 后,Google Play 会将 213 密度转换为 tvdpi。不知道为什么 eclipse manifest 工具中没有一个选项......
<compatible-screens>
....
<screen android:screenSize="large" android:screenDensity="213" />
</compatible-screens>
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
回答by user2506891
Documentation instructs us to avoid using
文档指示我们避免使用
<compatible-screens>
see here
instead you should use
请参阅此处,
您应该使用
<supports-screens
android:anyDensity="true"
android:xlargeScreens="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
Many of the other answers provided on this page are also effective answers. I have implemented them myself. Thanks everyone.
此页面上提供的许多其他答案也是有效的答案。我自己实现了它们。谢谢大家。
回答by shanraisshan
According to developer.android.com
If the app declares a <compatible-screens> element in the manifest, the element should include attributes that specify all of the size and density combinations for tablet screens that the app supports.
Note that, if possible, you should avoidusing the <compatible-screens> element in your app.
如果应用在清单中声明了 < compatible-screens> 元素,该元素应包含指定应用支持的平板电脑屏幕的所有尺寸和密度组合的属性。
请注意,如果可能,您应该避免在您的应用中使用 < compatible-screens> 元素。
Therefore, I do following tasks,
因此,我执行以下任务,
1- REMOVED <compatible-screens> from the manifest
1-从清单中删除 < compatible-screens>
<compatible-screens>
<!-- all small size screens -->
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<!--all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
<!-- all large size screens -->
<screen android:screenSize="large" android:screenDensity="ldpi" />
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />
<!-- all xlarge size screens -->
<screen android:screenSize="xlarge" android:screenDensity="ldpi" />
<screen android:screenSize="xlarge" android:screenDensity="mdpi" />
<screen android:screenSize="xlarge" android:screenDensity="hdpi" />
<screen android:screenSize="xlarge" android:screenDensity="xhdpi" />
<!-- Special case for Nexus 7 -->
<screen android:screenSize="large" android:screenDensity="213" />
<screen android:screenSize="normal" android:screenDensity="480" />
<screen android:screenSize="large" android:screenDensity="480" />
<screen android:screenSize="xlarge" android:screenDensity="480" />
</compatible-screens>
2- ADDED <supports-screens> attribute in the manifest
2-在清单中添加 < supports-screens> 属性
<supports-screens
android:xlargeScreens="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"
/>
3- ADDED android:required="false" attribute in <uses-feature> (as per my application requirement)in the manifest
3-在清单中的 < uses-feature> (根据我的应用程序要求)中添加了 android:required="false" 属性
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-feature android:name="android.hardware.bluetooth" android:required="false"/>
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.nfc" android:required="false"/>
Official Android documentation about Permissions that Imply Feature Requirements
关于隐含功能要求的权限的官方 Android 文档
A more detailed explanation about android:required false is present in ATTRIBUTES: android:required false
关于 android:required false 的更详细解释存在于ATTRIBUTES: android:required false
When you declare android:required="false" for a feature, it means that the application prefers to use the feature if present on the device, but that it is designed to function without the specified feature, if necessary(that is Telephony permission in case of tablets).
当你为一个特性声明 android:required="false" 时,这意味着应用程序更喜欢使用设备上存在的特性,但它被设计为在没有指定特性的情况下运行,如有必要(即电话许可片剂的情况下)。
By doing the above changes,
通过进行上述更改,
MORE THAN 2000 DEVICES were added in the Supported Android Devices list
支持的 Android 设备列表中添加了超过 2000 台设备
I hope that helps
我希望有帮助
回答by Kirit Vaghela
I get help from answer this question.
我从回答这个问题中得到帮助。
How to make android Phonegap available for tablets?
Yes. The problem was with permissions. I remove all permissions from AndroidManifest.xml than test the app and add permission one by one when getting missing permission error. Now my app is compatible with android phones as well as tablets.
是的。问题出在权限上。我从 AndroidManifest.xml 中删除所有权限,然后测试应用程序,并在出现权限丢失错误时一一添加权限。现在我的应用程序与安卓手机和平板电脑兼容。