Java tutorial
//package com.java2s; import android.net.Uri.Builder; import java.net.MalformedURLException; import java.net.URL; public class Main { static String zzb(String... strArr) { Builder builder = new Builder(); int length = strArr.length; int i = 0; while (i < length) { String str = strArr[i]; try { URL url = new URL(str); builder.appendQueryParameter("url", url.getProtocol() + "://" + url.getHost()); i++; } catch (MalformedURLException e) { throw new IllegalArgumentException("Invalid URL: " + str); } } return "weblogin:" + builder.build().getQuery(); } }