android app rate on google play and amazon

http://stackoverflow.com/questions/11393191/linking-back-to-amazon-app-store-for-ratings

 

    public static void ShowGooglePlayRateDialog(final Context mContext) {
        final Dialog dialog = new Dialog(mContext);
        dialog.setTitle("Rate " + APP_TITLE);
        mContext.startActivity(new Intent(Intent.ACTION_VIEW, Uri
                .parse("market://details?id=" + APP_PNAME)));
        dialog.dismiss();
    }
    
    public static void ShowAmazonRateDialog(final Context mContext) {
        final Dialog dialog = new Dialog(mContext);
        dialog.setTitle("Rate " + APP_TITLE);
        mContext.startActivity(new Intent(Intent.ACTION_VIEW, Uri
                .parse("amzn://apps/android?p=" + APP_PNAME)));
        dialog.dismiss();
    }    
    
    public static void ShowRateDialog(final Context mContext){
        String manufacturer= android.os.Build.MANUFACTURER;
        boolean isAmazon = manufacturer.equalsIgnoreCase("Amazon");
        if (isAmazon){
            ShowAmazonRateDialog(mContext);
        } else {
            ShowGooglePlayRateDialog(mContext);
        }
    }
posted @ 2014-04-09 09:17  xiaokang088  阅读(1117)  评论(0编辑  收藏  举报