Software Archive
Read-only legacy content
17061 Discussions

uses-feature needed for Amazon APK

Chris_C_8
Beginner
797 Views

My Android APK has been OK unchanged to date at the Amazon AppStore. However they now need more detailed settings in the manifest:

https://developer.amazon.com/public/support/submitting-your-app/tech-docs/targeting-amazon-devices-with-your-android-manifest

The geolocation plugin adds
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

The Amazon doc says the manifest needs these feature specs in the manifest if the GPS is optional:
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />

Is there any way to add these?

Thanks, Chris

0 Kudos
1 Solution
PaulF_IntelCorp
Employee
797 Views

Chris, you can clone the geo plugin and modify it or create a "dummy plugin" that consists of only a plugin.xml file to add those features into the AndroidManifest.xml file. See the "config-file" element about halfway down this doc page: https://cordova.apache.org/docs/en/5.1.1/plugin_ref/spec.html. I haven't verified this, but a plugin.xml file that contains something like this (borrowed from the existing geo plugin.xml file):

<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
    xmlns:rim="http://www.blackberry.com/ns/widgets"
    xmlns:android="http://schemas.android.com/apk/res/android"
    id="cordova-plugin-geolocation-manifest-addon"
    version="0.0.1"
>

    <name>Geolocation Manifest Addon</name>
    <description>Cordova Geolocation Manifest Addon Plugin</description>
    <license>MIT</license>

    <!-- android -->
    <platform name="android">
        <config-file target="AndroidManifest.xml" parent="/*">
            <uses-feature android:name="android.hardware.location" android:required="false" />
            <uses-feature android:name="android.hardware.location.gps" android:required="false" />
        </config-file>
    </platform>

</plugin>

Then, use the add local plugin with the plugin manager to copy this "plugin" to your project.

View solution in original post

0 Kudos
4 Replies
Amrita_C_Intel
Employee
797 Views

Hello,

When you add geolocation plugin in your project these default permissions are being added during that time.geo.PNG

0 Kudos
Chris_C_8
Beginner
797 Views

Thanks - I know that - but it's the extra uses-feature manifest entries that are needed.

0 Kudos
PaulF_IntelCorp
Employee
798 Views

Chris, you can clone the geo plugin and modify it or create a "dummy plugin" that consists of only a plugin.xml file to add those features into the AndroidManifest.xml file. See the "config-file" element about halfway down this doc page: https://cordova.apache.org/docs/en/5.1.1/plugin_ref/spec.html. I haven't verified this, but a plugin.xml file that contains something like this (borrowed from the existing geo plugin.xml file):

<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
    xmlns:rim="http://www.blackberry.com/ns/widgets"
    xmlns:android="http://schemas.android.com/apk/res/android"
    id="cordova-plugin-geolocation-manifest-addon"
    version="0.0.1"
>

    <name>Geolocation Manifest Addon</name>
    <description>Cordova Geolocation Manifest Addon Plugin</description>
    <license>MIT</license>

    <!-- android -->
    <platform name="android">
        <config-file target="AndroidManifest.xml" parent="/*">
            <uses-feature android:name="android.hardware.location" android:required="false" />
            <uses-feature android:name="android.hardware.location.gps" android:required="false" />
        </config-file>
    </platform>

</plugin>

Then, use the add local plugin with the plugin manager to copy this "plugin" to your project.

0 Kudos
Chris_C_8
Beginner
797 Views

Thanks Paul - I'll give that a go

0 Kudos
Reply