4

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.

gingerbreadboy
  • 7,386
  • 5
  • 36
  • 62
  • The thing is that protocol is use to receive specific action, not just start an application. `geo` is used to show a location (using the parameters), `mailto` is use to send a mail to a adress, also using the parameters. It is not simple made to start an app to the home page. For that, you need to send an intent... – AxelH Sep 13 '17 at 13:58

2 Answers2

3

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

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

Ahmed Elkoussy
  • 8,162
  • 10
  • 60
  • 85
  • Thanks for your response, but unfortunately I am constrained to using a protocol rather than an intent. – gingerbreadboy Sep 13 '17 at 13:51
  • @gingerbreadboy most welcome , I wanted to help but out of intents my knowledge is limited in this topic , hope someone can help you soon – Ahmed Elkoussy Sep 13 '17 at 13:54
  • Why are intents not an option? just check the url for the iOS `message://` and launch an intent for email – kira_codes Sep 13 '17 at 16:34
  • because of framework restrictions (which I have no control over) I am forced to use a third party plugin which will only accept a uri protocol. – gingerbreadboy Sep 14 '17 at 13:11