Android equivilent of ios message://

112 views Asked by At

Using custom uri protocols in both iOS and Android we can open default apps from our own apps. For example to open the default maps app iOS gives us maps:// and on Android we have geo://.

I want to open the default mail client on each. For the default mail app iOS gives us message:// but does anyone know what the Android equivalent would be to open the default mail app.

(I've tried 'mailto://' but on both platforms this starts a new email, rather than just launching the mail app)

Thanks.

EDIT: INTENTS are not an option, i need to use a URI scheme.

2

There are 2 answers

4
Ahmed Elkoussy On

You can use intent in Android to open apps for specific tasks

Please check out the documentation below

https://developer.android.com/reference/android/content/Intent.html

for mails specifically

https://developer.android.com/guide/components/intents-common.html#Email

0
CommonsWare On

Using custom uri protocols in both iOS and Android we can open default apps from our own apps

Only in selected scenarios. That approach is generally frowned upon in Android.

and on Android we have geo://

Note that geo: does not use slashes.

what the Android equivalent would be to open the default mail app

There is no URL scheme that will open a mail app, other than mailto:, which as you note is for composing a message.

If you are writing a native Android app, you can follow the instructions in the documentation for CATEGORY_APP_EMAIL to attempt to open an email app. Note that not all email apps will necessarily support this Intent structure.