title: How to use PackageManager to retrieve dialer/browser/sms app etc?
body: <p>I am writing a launcher and I need to find the dialer, browser, sms and camera app to put as shortcuts on the dock.</p>
  
  <p>I assume different vendors like Samsung/HTC/Google will all have different apps for each of these with different package names.</p>
  
  <p>Is there a way to use the PackageManager to get the default dialer app for example?</p>
  
  <p>EDIT:</p>
  
  <p>As per the advice given below I ended up implementing it like this:</p>
  
  <pre><code>Intent i = new Intent(Intent.ACTION_CALL);
  i.setData(Uri.parse("tel:123456789"));
  ResolveInfo resolveInfo = pm.resolveActivity(i, 0);
  AppModel result = null;
  if (resolveInfo != null) {
      ActivityInfo activityInfo = resolveInfo.activityInfo;
      if (activityInfo != null) {
          if ("android".equals(activityInfo.packageName)) {
              // no default activity.. choose first
              List&lt;ResolveInfo&gt; resolveInfos = m.queryIntentActivities(i, 0);
              for (ResolveInfo rInfo : resolveInfos) {
                  result = new AppModel(context, rInfo.activityInfo.applicationInfo);
                  break;
              }
  
          } else {
              ApplicationInfo appInfo = activityInfo.applicationInfo;
              if (appInfo != null) {
                  result = new AppModel(context, appInfo);
              }
          }
  
      }
  
  }
  </code></pre>