gpt4 book ai didi

android - 父使用功能 android.hardware.location

转载 作者:太空宇宙 更新时间:2023-11-03 13:47:26 24 4
gpt4 key购买 nike

在 AndroidManifest.xml 中父特性的使用(对于 uses-feature 标签)是否意味着与所有启用的子特性相同?

例如是下面的 block

<uses-feature android:name="android.hardware.location" android:required="false" />

等于

<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />

最佳答案

Does the usage of parent feature (for uses-feature tag) in AndroidManifest.xml mean the same as all enabled child features?

事实并非如此。您显示的 2 个 block 不相等。然而,情况恰恰相反:如果您声明了 android.hardware.location.gps,则自动暗示您也声明了 android.hardware.location

参见 the documentation获取更多信息。我复制了相关部分并用粗体强调:

android.hardware.location
The app uses one or more features on the device for determining location, such as GPS location, network location, or cell location.


android.hardware.location.gps
The app uses precise location coordinates obtained from a Global Positioning System (GPS) receiver on the device.

By using this feature, an app implies that it also uses the android.hardware.location feature, unless this parent feature is declared with the attribute android:required="false".


android.hardware.location.network
The app uses coarse location coordinates obtained from a network-based geolocation system supported on the device.

By using this feature, an app implies that it also uses the android.hardware.location feature, unless this parent feature is declared with the attribute android:required="false".

关于android - 父使用功能 android.hardware.location,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39635378/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com