Avoid Android Market filtering on optional use of location(避免在可选使用位置时进行 Android Market 过滤)
问题描述
在我的应用程序中,如果可用,我会尝试使用位置信息.因此,我的清单中有这些权限:
In my app I try and use location information if it is available. Hence I have those permissions in my manifest:
例如
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
注意:我没有 for location,这是我理解的用于在 Android Market 中过滤的标签.
NOTE: I DO NOT have a for location, which is the tag I understood was used for filtering in Android Market.
当我上传到 Android 市场时,我收到以下报告:
When I upload to Android market I get this reported:
此 apk 请求 4 个功能用于 Android Market 过滤android.hardware.location.networkandroid.hardware.locationandroid.hardware.location.gpsandroid.hardware.touchscreen
This apk requests 4 features that will be used for Android Market filtering android.hardware.location.network android.hardware.location android.hardware.location.gps android.hardware.touchscreen
这对我来说表明它只会显示在具有 location 和 location.network 和 gps 硬件的设备上.
which to me suggests that it will only show up for devices that have location and location.network and gps hardware.
但我对位置的使用是可选的,如果它不可用,应用程序将运行.
But my use of location is optional and the app will work if it is not avaialble.
我应该从我的清单中删除这些权限吗(当我尝试使用它时会出现异常吗?)?
Should I remove those permissions from my manifest (will I get exceptions when I try to use it?)?
有没有办法离开权限并避免基于它们的Android Market过滤?
Is there a way to leave the permissions and avoidAndroid Market filtering based on them?
推荐答案
我的应用程序有同样的问题.我猜这是因为 minSdkVersion
是 4,即 Android 1.6.来自 <uses-功能>
文档:
My application has the same problem. I guess this is because the minSdkVersion
is 4, i.e. Android 1.6. From the <uses-feature>
documentation:
一般来说,如果您的应用程序设计为在 Android 1.6 及更早版本上运行,则 android:required 属性在 API 中不可用,并且 Android Market 假定所有声明都是必需的.
In general, if your application is designed to run on Android 1.6 and earlier versions, the android:required attribute is not available in the API and Android Market assumes that any and all declarations are required.
这是有道理的,因为当您将功能声明为可选时,您应该使用 hasSystemFeature()
方法从 PackageManager
检查是否当前设备具有该特定功能.但是,此方法本身仅在 API 级别 5 中可用!
This makes sense because when you declare a feature as optional, you are supposed to use the hasSystemFeature()
method from the PackageManager
to check whether the current device has that particular feature. However, this method itself is available only from API Level 5!
这篇关于避免在可选使用位置时进行 Android Market 过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:避免在可选使用位置时进行 Android Market 过滤
基础教程推荐
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01