Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.net.Uri;

public class Main {
    public static String getGooglePlayUrl(String utmSource, String utmContent) {
        Uri.Builder builder = new Uri.Builder();
        builder.scheme("https");
        builder.authority("play.google.com");
        builder.path("/store/apps/details");
        builder.appendQueryParameter("id", "com.konifar.materialcat");

        if (utmSource != null && utmContent != null) {
            StringBuffer sb = new StringBuffer();
            sb.append("utm_source=");
            sb.append(utmSource);
            sb.append("&utm_medium=direct");
            sb.append("&");
            sb.append("utm_content=");
            sb.append(utmContent);
            builder.appendQueryParameter("referrer", sb.toString());
        }

        return builder.build().toString();
    }
}