Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / How to Create a Rate Us Button?

Author
Message
PaulTony
6
Years of Service
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 3rd Dec 2017 15:28
Hi everyone,

Could you please put me in the right direction in creating a simple Rate Us button that sends users to the play store where the app is located. I tired using various commands from the http section in the Help but am having no luck. Is their something that I am missing? I see that there is a rate us function, but this is only applicable to iOS.

Thanks again for your help!
PaulTony
6
Years of Service
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 3rd Dec 2017 21:19
I found the answer. Looks like the OpenBrowser("paste your google app page URL here") command does the trick quite well.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 5th Dec 2017 15:05
That's how I've done it in all my apps and games. Glad you found a solution
xuxu231
7
Years of Service
User Offline
Joined: 10th Oct 2016
Location:
Posted: 28th Dec 2017 08:55
Rate me code

Add a button to a layout and create an activity, add the following code to your activity. Replace [Id] with your app id.

private boolean MyStartActivity(Intent aIntent) {
try
{
startActivity(aIntent);
return true;
}
catch (ActivityNotFoundException e)
{
return false;
}
}

//On click event for rate this app button
public void btnRateAppOnClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW);
//Try Google play
intent.setData(Uri.parse("market://details?id=[Id]"));
if (!MyStartActivity(intent)) {
//Market (Google play) app seems not installed, let's try to open a webbrowser
intent.setData(Uri.parse("https://play.google.com/store/apps/details?[Id]"));
if (!MyStartActivity(intent)) {
//Well if this also fails, we have run out of options, inform the user.
Toast.makeText(this, "Could not open Android market, please install the market app.", Toast.LENGTH_SHORT).show();
}
}
}

Login to post a reply

Server time is: 2024-04-20 11:37:55
Your offset time is: 2024-04-20 11:37:55