New tutorial: How to create a “Rank this app” button

Just finished writing a small tutorial on how to create a rate this app button.
Check it out on my blog:

http://martin.cubeactive.com/?p=340

Thanks Martin. A good concise guide for this particular task. I like how you’ve included the right exception handling to fail gracefully if the Android Market / Google Play app isn’t present (or even the web browser doesn’t work!).

Looking at that code I just noticed - even though the Android Market has been renamed “Google Play”, the Intent URIs still start with “market://” :slight_smile: I wonder if that will be permanent…

Great, thanks,
I had the same idea, didn’t know how to do it.

Which target are you using? In my version I only see:
void startActivity()

Don’t get anything back. I can only use void tartActivityForResult() , then the implemented onActivityResult I get an error and result code and can go further depending on the result.

Daniel

You are absolutely right Daniel, I forgot to include an important function that helps to start the activity. The tutorial is updated and I’ve changed the name of the StartActivity function to MyStartActivity to better indicate that it’s a custom function.

If im correct this code should be compatible with all api levels, im using the same code in my apps that have minsdk level 7, but I do not see any reason why it should not work in earlier sdk levels, the StartActivity methode is api level 1. Only the way I use the onclick event as an function of my activity is api level 4. See: R.attr  |  Android Developers

I Hope it’s usefull for you.[hr]

Yeah I noticed the market uri too. They might change it in the future, maybe they already are using a play uri in new builds of the market app. However to insure the code works with older Android markets apps you should still use the old uri. So if they change the uri it will take some years before you can remove it from your code.

Hi Martin! Nice tutorial and example, thanks!