6

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..

Sudarshan
  • 1,291
  • 3
  • 26
  • 35
  • You want the person default e-mail package app? – Rotary Heart Mar 12 '13 at 05:00
  • Not the default.Since we can make a thrid party Email-client as our device default Email client.. I need the in built mail client for each device – Sudarshan Mar 12 '13 at 05:15
  • I think the best you can do is get a list of Activities that can send a `message/rfc822` and iterate over them to inspect their package names, but that won't tell you whether they are the default. Why do you need this, if I may ask? – Karakuri Mar 12 '13 at 05:41
  • @Karakuri How to find a app can send message/rfc822, i couldnt get a way to do that.. Just to monitor the application in android – Sudarshan Mar 12 '13 at 08:38

1 Answers1

4

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.

Karakuri
  • 38,365
  • 12
  • 84
  • 104