避免在选择使用位置的Andr​​oid Market的滤波位置、Andr、Market、oid

2023-09-07 04:19:46 作者:你想要的自由

在我的应用我尝试和使用位置信息(如果可用)。因此,我有这些权限在我的清单:

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" />

注:我没有对位置,这是我理解的是用于在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.network   android.hardware.location   android.hardware.location.gps   android.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.network和GPS硬件设备。

which to me suggests that it will only show up for devices that have location and location.network and gps hardware.

但我使用的位置是可选的,应用程序将工作,如果它不是avaialble。

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?)?

有没有办法离开基于它们的权限和avoidAndroid市场过滤?

Is there a way to leave the permissions and avoidAndroid Market filtering based on them?

推荐答案

我的应用程序有同样的问题。我想这是因为的minSdkVersion 4,也就是Android 1.6的。从 &LT;使用特征&GT; 文档:

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!

 
精彩推荐
图片推荐