Here you can find the source of encode(String base)
public static String encode(String base)
//package com.java2s; import android.net.Uri; public class Main { public static String encode(String base) { String encoded = Uri.encode(base); return encodeURI(encoded); }//from w ww .j a v a2 s. c om public static String encodeURI(String encoded) { encoded = encoded.replace("(", "%28"); encoded = encoded.replace(")", "%29"); encoded = encoded.replace("!", "%21"); encoded = encoded.replace("\'", "%27"); encoded = encoded.replace("*", "%2A"); return encoded; } }