【问题标题】:Parent uses-feature android.hardware.location父用途-功能 android.hardware.location
【发布时间】:2016-09-22 17:56:19
【问题描述】:

AndroidManifest.xml 中父功能(uses-feature 标签)的使用是否与所有启用的子功能相同?

例如是下面的块

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

【问题讨论】:

    标签: android android-manifest uses-feature


    【解决方案1】:

    AndroidManifest.xml 中父功能(用于 uses-feature 标签)的使用是否与所有启用的子功能相同?

    它没有。您显示的 2 个块不相等。反之亦然:如果您声明 android.hardware.location.gps,则自动暗示您也声明了 android.hardware.location

    请参阅the documentation 了解更多信息。我复制了相关部分并用粗体强调:

    android.hardware.location
    该应用使用设备上的一项或多项功能来确定位置,例如 GPS 位置、网络位置、手机位置。


    android.hardware.location.gps
    该应用使用从设备上的全球定位系统(GPS)接收器获得的精确位置坐标。

    通过使用此功能,应用意味着它也使用了 android.hardware.location 功能,除非使用属性 android:required="false" 声明此父功能。


    android.hardware.location.network
    该应用使用从设备支持的基于网络的地理位置系统获得的粗略位置坐标。

    通过使用此功能,应用意味着它也使用了 android.hardware.location 功能,除非使用属性 android:required="false" 声明此父功能。

    【讨论】:

      猜你喜欢
      • 2016-04-19
      • 1970-01-01
      • 1970-01-01
      • 2010-10-17
      • 2019-10-01
      • 2018-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多