Android: How to get the native Email clients package name

android, email

Solution

This isn't a complete answer, but here is how to get a list of Activities that can send `message/rfc822`:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("message/rfc822");
PackageManager pkgManager = context.getPackageManager();
List<ResolveInfo> activities = pkgManager.queryIntentActivities(intent, 0);

You can iterate over the list. See `ResolveInfo` documentation for fields of interest.

Problem

In Samsung devices com.sec.android.email is the default In-Built Mail client, but in HTC it is com.htc.android.mail.. My question is is there any way to get the default mail client package name in android device irrespective of the different company builds..

Original source