title: Check if a package exists on Android Market
body: <p>I am trying to find if a specific package already exists in Android Market.</p>
  
  <p>I know I have no problem to actually <b>open</b> the Market application in the package page:</p>
  
  <pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);
  intent.setData(Uri.parse("market://details?id=" + PACKAGE_NAME));
  startActivity(intent);
  </code></pre>
  
  <p>But I want to know if it exists before I try this - so the user won't get the default "not found" market page.</p>
  
  <p>One way to do it, of course, is to use the web Market URL with an HttpClient (https://market.android.com/details?id=) - this will return 404 if the package does not exist.</p>
  
  <p>However, I'm looking for a way to do that with the Market application installed on the device.</p>