Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 935
blueeyes Avatar asked Nov 29 '20 17:11

blueeyes


2 Answers

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>
like image 37
RunningMan Avatar answered Sep 22 '22 13:09

RunningMan


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>
like image 172
okarakose Avatar answered Sep 22 '22 13:09

okarakose