I spent a good few hours trying to launch Boxer e-mail client from an app i’m currently working on. I thought it would be piece of cake when i read throught their documentation, and sure, it was easy on iOS using the url scheme awemailclient://
The documentation did not mention the Android version of Boxer don’t support this. It took me a few hours to realize url scheme was a dead end when it comes to Android, and another bunch of hours to find out how to do it.
The solution, as always, is quite simple and also make sence. You pretty much do a regular intent of type message/rfc822. What you need to add to that is code to show only Boxer, not all apps on the phone that can handle e-mails. And that is done with one line of code.
This example is in C# using Xamarin, but i’m sure it’s easy to translate to Java if needed:
//Create your intent var intent = new Intent(Intent.ActionSend); //This is what makes boxer the only option! intent.SetPackage("com.boxer.email"); //Set the type intent.SetType("message/rfc822"); //Put in recipient, subject and body intent.PutExtra(Intent.ExtraEmail, new string[] { "recipient@contoso.com" }); intent.PutExtra(Intent.ExtraSubject, "Hello World"); intent.PutExtra(Intent.ExtraText, "This is a message!")); Android.App.Application.Context.StartActivity(intent);
Follow jonlin76