Unable to provide the rating feature - android

I am trying to provide rating feature in my app but when I click on rate its says, "Requested item not found".

Try using this code
private void rateAppOnPlayStore() {
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 google play app.",
Toast.LENGTH_LONG).show();
}
}
This will work for Market app also.

Related

No apps can perform this action to open Instagram URL

I tried to open page my Instagram page for a user who wants to follow. I tried some code to do that work:
private void followInsta() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://www.instagram.com/motivationalquotes.app"));
try {
intent.setPackage("com.instagram.android");
startActivityForResult(Intent.createChooser(intent, mContext.getResources().getString(R.string.app_name)), 1000);
} catch (Exception e) {
try {
Log.e("FollowInsta1>>>", Log.getStackTraceString(e));
intent.addCategory(Intent.CATEGORY_BROWSABLE);
startActivityForResult(Intent.createChooser(intent, mContext.getResources().getString(R.string.app_name)), 1000);
} catch (Exception ex) {
Log.e("FollowInsta2>>>", Log.getStackTraceString(ex));
}
}
}
I called this from a click event but its always open dialog with a message My app name and 'No apps can perform this action'
This is only happening with the Samsung Galaxy J8 device. But it normally works on other devices. If anyone knows what to try for these types of devices then please tell me. I also tried this to solve my problem but it didn't work!
Try this snippet:
Uri uri = Uri.parse("http://instagram.com/_u/motivationalquotes.app");
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/motivationalquotes.app")));
}
This should open the app if installed or call the browser.

How to install apps from GooglePlay from Activity ? Android

I made a simple code that will download a app from Google Play.I tried
the code and tested it on real device but I got an error called "No application can perform this action."I declared android.permission.INTERNET in the manifest, but still doesn't work.
I would be glad if you can help me out.
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.setData(Uri.parse("market://developer?*/urlofgoogleplay*/"));
chooser = Intent.createChooser(i,"Launch Market");
startActivity(chooser);
public static void linkGooglePlay(Context context) {
Uri uri = Uri.parse("market://details?id=" + context.getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
context.startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
context.startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://play.google.com/store/apps/details?id=" + context.getPackageName())));
}
}
This is the right syntax:
i.setData(Uri.parse("market://details?id=" + app_package));
Here's the documentation

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

Directly open up the Play store rating screen from our app in android

Is it possible to directly open up the rating screen dialog of play store app of a particular appllication?
Try this..
Uri uri = Uri.parse("market://details?id=" + context.getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
Toast.makeText(context, "Couldn't launch the market", Toast.LENGTH_LONG).show();
}
Or
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=Your Main Package Name"));
startActivity(intent);

Rate Google Play application directly in app [duplicate]

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);

Categories

Resources