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 过滤
基础教程推荐
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
