title: How distinguish hangout from google talk app?
body: <p>From my app I want to run <a href="https://play.google.com/store/apps/details?id=com.google.android.talk" rel="nofollow">Hangouts</a> and from that app users can create video calls.<br> But on some target devices users have native Google Talk app (not updated to Hangouts). </p>
  
  <p>The problem is: Google Talk and Hangouts - this is the same apps with the identical package name <code>com.google.android.talk</code>, and I don't know how distinguish them. </p>
  
  <p>My logic: when I found package on device - I just run app. If no - open market page with this app.</p>
  
  <p>Maybe someone knows, how distinguish hangout from google talk app?</p>
  
  <p>My code:</p>
  
  <pre><code>public void startApplication(String packageName){
          try
          {
              Intent intent = new Intent("android.intent.action.MAIN");
              intent.addCategory("android.intent.category.LAUNCHER");
              intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
              List&lt;ResolveInfo&gt; resolveInfoList = getPackageManager().queryIntentActivities(intent, 0);
              for(ResolveInfo info : resolveInfoList)
                  if(info.activityInfo.packageName.equalsIgnoreCase(packageName))
                  {
                      launchComponent(info.activityInfo.packageName, info.activityInfo.name);
                      return;
                  }
              showInMarket(packageName);
          }
          catch (Exception e)
          {
              showInMarket(packageName);
          }
      }
  private void launchComponent(String packageName, String name){
          Intent intent = new Intent("android.intent.action.MAIN");
          intent.addCategory("android.intent.category.LAUNCHER");
          intent.setComponent(new ComponentName(packageName, name));
          intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          startActivity(intent);
      }
      private void showInMarket(String packageName){
          Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName));
          intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          startActivity(intent);
      }
  </code></pre>
  
  <p><strong>UPD</strong> </p>
  
  <p>Now I have only one idea: to check if the <code>publicSourceDir</code> is <code>/system/app/Talk.apk</code> - if "yes" - we have preset "Google Talk" app - but I don't think this is good solution. <br> What do you thing about it?</p>
  
  <pre><code>String publicSourceDir = getPackageManager()
                              .getPackageInfo(info.activityInfo.packageName, 0).applicationInfo.publicSourceDir;
  if(!publicSourceDir.toLowerCase().endsWith(GOOGLE_HANGOUT_SYSTEM_APK.toLowerCase())){
                        ......
                      }
  </code></pre>