如何在"评价此应用程序"和" More Apps"选项中添加Google Play商店以及三星应用商店的链接



我已经在Play商店和三星Galaxy应用商店发布了我的应用程序,今天三星拒绝了我的应用程序,因为我给我的应用程序有两个选项,一个是"评分我们"和"来自开发人员的更多应用程序",如果有人点击此选项,它在Google Play中打开而不是在三星应用商店中打开,所以我想知道如何在一个代码中添加两个应用商店链接

这是我的更多应用代码

else if (id == R.id.nav_more) {
try {
Uri uri = Uri.parse("https://play.google.com/store/apps/developer?id=my+apps"); // missing 'http://' will cause crashed
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
} catch (Exception ex) {
}

这是评价应用程序代码

public void rateUsOnPlayStore() {
Uri uri = Uri.parse("market://details?id=" + this.getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
// To count with Play market backstack, After pressing back button,
// to taken back to our application, we need to add following flags to intent.
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY |
Intent.FLAG_ACTIVITY_NEW_DOCUMENT |
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
try {
startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://play.google.com/store/apps/details?id="  + this.getPackageName())));
}
}

三星Galaxy App Store的软件包名称是com.sec.android.app.samsungapps,因此要打开它,请尝试以下操作:

public static void openGalaxyStore(Context context, String packageName) {
Uri uri = Uri.parse("http://www.samsungapps.com/appquery/appDetail.as?appId=" + packageName);
Intent goToMarket = new Intent();
goToMarket.setClassName("com.sec.android.app.samsungapps", "com.sec.android.app.samsungapps.Main");
goToMarket.setData(uri);
try {
context.startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
e.printStackTrace();
}
}

最新更新