Rate Google Play application directly in app [duplicate] - android

This question already has answers here:
Use application to rate it on market [duplicate]
(4 answers)
Closed 3 years ago.
I need to make rate option in my android app.
I found this link
but I'm not sure that want I search. I want to just provide ability for users to rate my app on Google Play.

The rating is done through market app so that ratings can be trusted. If apps were allowed to handle the rating themselves, then the developer could manipulate the app's rating any time. So there is no way you can handle the rating yourself. You can only prompt the user to your app page on Google Play and ask them to rate your app for more support.
Use the built-in intent to launch market
private void launchMarket() {
Uri uri = Uri.parse("market://details?id=" + getPackageName());
Intent myAppLinkToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(myAppLinkToMarket);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, " unable to find market app", Toast.LENGTH_LONG).show();
}
}

Simple do this...
final String appPackageName = "your.package.name";
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + appPackageName)));
}

You can use 3rd party tool. Here are some commonly used solutions:
appirater: https://github.com/drewjw81/appirater-android/
apptentive: http://www.apptentive.com/
polljoy: https://polljoy.com
AppRater: https://github.com/delight-im/AppRater

public void launchMarket()
{
Uri uri = Uri.parse("market://details?id=" + this.getPackageName());
Intent myAppLinkToMarket = new Intent(Intent.ACTION_VIEW, uri);
try
{
mContext.startActivity(myAppLinkToMarket);
}
catch (ActivityNotFoundException e)
{
Toast.makeText(this, " Sorry, Not able to open!", Toast.LENGTH_SHORT).show();
}
}

Users can't rate your app directly from within your app. They must go to Google Play and rate it. Like the link shows, you must redirect the user to view your app on Google Play:
mContext.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + APP_PNAME)));

For the code below, I have used try and catch method. The try and catch method will work as follows. On button click, the try method will try to search for the Google play store app on your android phone and launches it if is already installed and navigates to your application on the play store. However, in case you don't have the play store app on your android phone, catch method is executed and launches browser installed on your application and navigates to your application on the play store. getPackageName() is an inbuilt function that gets your project package name. You can add it manually as a string.
Also see for amazon store
String package="com.example.android";
The full code.
button.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
try {
Uri uri = Uri.parse("market://details?id="+getPackageName()+"");
Intent goMarket = new Intent(Intent.ACTION_VIEW, uri);
startActivity(goMarket);
}catch (ActivityNotFoundException e){
Uri uri = Uri.parse("https://play.google.com/store/apps/details?id="+getPackageName()+"");
Intent goMarket = new Intent(Intent.ACTION_VIEW, uri);
startActivity(goMarket);
}
}
});

I was searching for a feature similar to iOS, where the user doesn't need to be redirected to play store and again asked to write his reviews. Initially, I thought this was impossible but thankfully my understanding was outdated. Found this app which does that searching for code though.

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.test(This is the package name)"));
startActivity(intent);

I always use a method like this one
private void launchMarket() {
Uri uri = Uri.parse("market://details?id=" + getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, "couldn't launch the market", Toast.LENGTH_LONG).show();
}
}

Paste this simple code to go play store rating page from your Application
Intent intent1 = new Intent(Intent.ACTION_VIEW,
Uri.parse("market://details?id="
+ MainActivity.this.getPackageName()));
startActivity(intent1);

Related

How to follow on Instagram directly from Android app?

I want to add a button to my android app that allows my app users to follow me on Instagram directly from my app. How do I do this? Currently I have this code that allows my app users to open my Instagram profile:
Uri uri = Uri.parse("http://instagram.com/_u/" + R.string.instagram_id);
Intent likeIng = new Intent(Intent.ACTION_VIEW, uri);
likeIng.setPackage("com.instagram.android");
try {
startActivity(likeIng);
} catch (ActivityNotFoundException e) {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://instagram.com/" + R.string.instagram_id)));
}

Is it possible to open Play Store from application with a predefined search?

The following code opens Play store from my android application:
final String appPackageName = getPackageName();
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(
Intent.ACTION_VIEW,
Uri.parse("http://play.google.com/store/apps/details?id="
+ appPackageName)));
}
Programmatically i want the user to see the search result for all the "File Explorers" available on the Play store as soon as it opens. When i fire the intent, what i see is Picture1 what i want is Picture2. Is it possible? Thanks in advance.
Try this:
startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse("market://search?q=File%20Explorers")));
"market://" is resolved to the google play store URL and the "search?q=File%20Explorers" will open the search for the given parameters. %20 is the encoding for a space.

make user see all of my published application in google play store

I am these codes to redirect a app user to see all my published apps in google play. The problem is I am confused what to write in place of -publisher_name. How is that different from developer's name?
Uri uri = Uri.parse("market://search?q=pub:<publisher_name>");
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
startActivity(new Intent(
Intent.ACTION_VIEW,
Uri.parse("http://play.google.com/store/search?q=pub:<publisher_name>")));
}
It is described at the Developer Page for Android.
http://developer.android.com/distribute/googleplay/promote/linking.html#OpeningPublisher
http://developer.android.com/distribute/googleplay/promote/linking.html#android-app
Quote:
"
From an Android app:
market://search?q=pub:<publisher_name>
Here's an example:
http://play.google.com/store/search?q=pub:Google+Inc.

Trying to write code to go to the amazon app store

I am selling a puzzle up that always peaple to upgrade to a full version by bringing them to my app page on Google play. (using the following code)
Uri uri = Uri.parse("market://details?id=com.fairhvaenapps.toddpuzzle");
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
Toast.makeText( cGlobals.MainHome, "Couldn't launch market", Toast.LENGTH_LONG).show();
}
I would like to do this for the amazon app store to, but I could not find any documentation on how to do it.
amzn://apps/android?p=com.something
https://developer.amazon.com/post/Tx3A1TVL67TB24B/Linking-To-the-Amazon-Appstore-for-Android.html

how to implement Rate Us in android

I have made an application now i want to implement Rate Us feature in it. so for that i have added this code in my app
i = new Intent(Intent.ACTION_VIEW , Uri.parse("market://details?id=com.bet.compny"));
startActivity(i);
break;
but when i click on the button for rate us getting force close. here is my log cat output.
android.content.ActivityNotFoundException: No Activity found to handle Intent {
act=android.intent.action.VIEW dat=market://details?id=com.bet.compny }
Any help would be appretiated.
Idk why you get the Error, but this should actually work. I also do it like this:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + APP_PNAME)));
But keep in mind that this would crash, if you are testing it on an Emulator/ a device without a play store. So I would suggest you to wrap it in a try and catch
This error occurs when running on a device without the Google PlayStore.
I guess you might be running this on a emulator device which doesn't have Playstore and hence the error.
Implement using try catch as follows:
try{
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id="+getPackageName())));
}
catch (ActivityNotFoundException e){
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id="+getPackageName())));
}
I am always using below code which is useful for us:
Intent rateIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + context.getPackageName()));
startActivity(rateIntent);
In think it will help full for you.
This is the best way to do it;
Appirater is an android library based off the original Appirater By
Arash Payan Appirater iPhone. The goal is to create a cleanly designed
App Rating prompt that you can drop into any android app that will
help remind your users to review your app on the android Market.
https://github.com/sbstrm/appirater-android
try {
Uri marketUri = Uri.parse("market://details?id=" + getPackageName());
Intent marketIntent = new Intent(Intent.ACTION_VIEW, marketUri);
startActivity(marketIntent);
}catch(ActivityNotFoundException e) {
Uri marketUri = Uri.parse("https://play.google.com/store/apps/details?id=" + getPackageName());
Intent marketIntent = new Intent(Intent.ACTION_VIEW, marketUri);
startActivity(marketIntent);
}
Best and Simple Code
private final String mStoreLink;
Without Activity need context/activity
this.mStoreLink = "market://details?id=" + activity.getPackageName();
Creat a method like this.
public void rateUsOnGooglePlay() {
final Uri marketUri = Uri.parse(mStoreLink);
try {
activity.startActivity(new Intent(Intent.ACTION_VIEW, marketUri));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(activity, "Couldn't find PlayStore on this device", Toast.LENGTH_SHORT).show();
}
}
This commonly happens on a device without the Google Play Store
i think u have test this code in emulator, and emulator have no plastore application, so this error came.
I have implement this and my code is like this.
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=applicationID of play sotre")));
please put try catch in bellow code.
and try this code in android device.
Uri marketUri = Uri.parse("market://details?id=" + packageName);
Intent marketIntent = new Intent(Intent.ACTION_VIEW, marketUri);
startActivity(marketIntent);
in my case, I wanted the user to click on "MORE BY US" and he would be redirected
to my playstore homepage, but the app was crashing. The reason was simple. I added extra spaces and lines to the link something like below:
<string name = "more_app_link">
playstore.link...............
</string>
then I removed extra lines and spaces like this:
<string name = "more_app_link">playstore.link...............</string>
and it worked very well.

Categories

Resources