title: Prompt user to rate an Android app inside the App
body: <p>In my Android app, I want to prompt the user at some point of time to rate the app in Android market.</p>
  
  <p>Having searched for an approach, I've found some code <a href="http://www.androidsnippets.com/prompt-engaged-users-to-rate-your-app-in-the-android-market-appirater">on this website</a>. This code seems to work very well.</p>
  
  <p>But unfortunately, this code seems to raise a "Forced Close" error message when Android market is not installed on the user's phone. Is there any way to check if Android market is installed and, if not, don't try to execute the code?</p>
  
  <p>The line which raises the error is probably this one as it cannot parse the URI:</p>
  
  <pre><code>mContext.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + APP_PNAME)));
  </code></pre>
  
  <p>And, by the way, are there any other things which could be improved in that code?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>A few years later, I've put all the code into a small library project: <a href="https://github.com/marcow/AppRater">AppRater on GitHub</a></p>