blueeyes
blueeyes

Reputation: 143

Android 11 | Package visibility change for map navigation

From Android 11 there is a change in App visibility. In my application, I need to navigate to mail apps and navigation apps.

The below code needs to be added in manifest

<manifest package="com.example.game">
    <queries>
        <intent>
            <action android:name="android.intent.action.SEND" />
            <data android:mimeType="image/jpeg" />
        </intent>
    </queries>
    ...
</manifest>

According to the documentation the above example allows your app to see installed apps that support JPEG image sharing:

https://developer.android.com/training/basics/intents/package-visibility#intent-signature

Could anyone please help what "action" and "data" I need to use for navigation app (google navigation,uber) and mail apps(like outllok,gmail)?

Thanks in advance!

Upvotes: 8

Views: 5247

Answers (3)

okarakose
okarakose

Reputation: 3742

You should use "geo" scheme for queries intent in your AndroidManifest.xml file.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example">

    ...

    <queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="geo" />
        </intent>
    </queries>

</manifest>

Upvotes: 10

RunningMan
RunningMan

Reputation: 101

I found my app not working after the Android 11 upgrade which was frustrating and there seemed to be gaps in the release notes to do with the intent queries.

The following code can be used for email as i used a SENDTO intent however if you used a SEND intent, change it to be that.

<queries>
    <intent>
        <action android:name="android.intent.action.SENDTO" />
        <data android:scheme="mailto" />
    </intent>
</queries>

Upvotes: 9

Magnus G
Magnus G

Reputation: 111

Adding this intent under queries in manifest worked for me

<intent>
    <action android:name="android.intent.action.VIEW" />
    <data android:scheme="google.navigation" />
</intent>

Upvotes: 5

Related Questions