20

我目前在 Google Play 商店的 android 应用程序中使用以下代码来请求对我的应用程序进行审查和评级。

Intent goToMarket = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.yapp.blah"));
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(goToMarket);

如何链接回亚马逊应用商店或亚马逊市场以实现相同的目标?

4

4 回答 4

15

只需使用以下代码。起初尝试通过URI打开市场应用程序,但如果找不到打开Web链接。

public static final String MARKET_AMAZON_URL = "amzn://apps/android?p=";
public static final String WEB_AMAZON_URL = "http://www.amazon.com/gp/mas/dl/android?p=";

    private static void openOnAmazonMarket(Context context, String packageName) {

    try {
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(MARKET_AMAZON_URL + packageName));
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    } catch (android.content.ActivityNotFoundException anfe) {
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(WEB_AMAZON_URL + packageName));
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

}

Google Play 和三星 Galaxy Apps 的链接如下:

public static final String MARKET_GOOGLE_URL = "market://details?id=";
public static final String WEB_GOOGLE_URL = "http://play.google.com/store/apps/details?id=";

public static final String MARKET_SAMSUNG_URL = "samsungapps://ProductDetail/";
public static final String WEB_SAMSUNG_URL = "http://www.samsungapps.com/appquery/appDetail.as?appId=";
于 2015-02-10T21:39:46.813 回答
14

您可以执行以下操作:

  1. 检查设备是否基于其制造商。例如:https ://developer.amazon.com/sdk/fire/specifications.html

  2. 要撰写评论和打开亚马逊应用商店,请使用以下意图

    amzn://apps/android?p=package_name
    

    p=Link特定包名称的详细信息页面的 位置。

参考:亚马逊开发者链接。

https://developer.amazon.com/sdk/in-app-purchasing/sample-code/deeplink.html

于 2013-06-10T11:37:11.763 回答
1

这是首选方法,将直接打开适用于 Android 的 Amazon Appstore:

amzn://apps/android?p=<package_name>

来源:https ://developer.amazon.com/public/community/post/Tx3A1TVL67TB24B/Linking-To-the-Amazon-Appstore-for-Android

于 2014-01-27T21:25:40.080 回答
-1

有两种方法可以做到:

选项 1:链接到亚马逊零售网站

这种类型的链接将被适用于 Android 的亚马逊应用商店以及设备上任何已安装的浏览器获取。基本网址如下:

http://www.amazon.com/gp/mas/dl/android

选项 2:直接链接到适用于 Android 的 Amazon Appstore

这个特殊格式的链接是首选方法,它将直接打开适用于 Android 的 Amazon Appstore。基本网址如下:

amzn://apps/android?

http://www.amazon.com/HUT-Solution-Loving-Pakman/dp/B00HYT72LU

于 2014-01-31T10:14:03.147 回答