直接在应用中为Google Play应用评分

时间:2012-06-30 00:46:05

标签: android google-play rate

我需要在我的Android应用中制作费率选项。

我发现了link

但我不确定是否要搜索。我想为用户提供在Google Play上为我的应用评分的能力。

10 个答案:

答案 0 :(得分:118)

评级是通过市场应用程序完成的,因此可以信任评级。如果允许应用程序自行处理评级,那么开发人员可以随时操纵应用程序的评级。所以你无法自己处理评级。您只能提醒用户访问Google Play上的应用页面,并要求他们为您的应用评分以获得更多支持。

使用内置意图启动市场

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

答案 1 :(得分:8)

简单做到这一点......

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

答案 2 :(得分:7)

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

答案 3 :(得分:6)

您可以使用第三方工具。以下是一些常用的解决方案:

appirater:https://github.com/drewjw81/appirater-android/

apptentive:http://www.apptentive.com/

民意调查:https://polljoy.com

AppRater:https://github.com/delight-im/AppRater

答案 4 :(得分:3)

用户无法直接在您的应用中为您的应用评分。他们必须访问Google Play并对其进行评分。与链接显示一样,您必须重定向用户才能在Google Play上查看您的应用:

mContext.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + APP_PNAME)));

答案 5 :(得分:2)

对于下面的代码,我使用了try和catch方法。 try和catch方法将如下工作。点击按钮后,try方法将尝试在Android手机上搜索Google Play商店应用,如果已安装则启动它并导航到Play商店中的应用程序。但是,如果您的Android手机上没有Play商店应用程序,则执行catch方法并启动应用程序上安装的浏览器并导航到Play商店中的应用程序。 getPackageName()是一个内置函数,用于获取项目包名称。您可以手动将其添加为字符串。

另见amazon store

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

完整的代码。

Map<Device, List<Message>> dataMap

答案 6 :(得分:1)

我正在搜索类似于iOS的功能,该用户不需要将用户重定向到Play商店,而是再次要求写评论。最初,我认为这是不可能的,但幸运的是我的理解已经过时了。找到了这个app,它虽然可以搜索代码。

答案 7 :(得分:0)

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

答案 8 :(得分:0)

粘贴此简单代码以从您的应用程序中播放商店评级页面

Intent intent1 = new Intent(Intent.ACTION_VIEW,
                        Uri.parse("market://details?id="
                                + MainActivity.this.getPackageName()));
startActivity(intent1);

答案 9 :(得分:0)

我总是使用这样的方法

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();
    }
}
相关问题