Android Utililty Methods URL Decode

List of utility methods to do URL Decode

Description

The list of methods to do URL Decode are organized into topic(s).

Method

MapdecodeUrlFormEncoded(String data)
decode Url Form Encoded
HashMap<String, String> map = new HashMap<String, String>();
String d[] = data.split("&");
for (String s : d) {
    String t[] = s.split("=");
    String key = t[0];
    String value = t[1];
    map.put(key, value);
return map;
StringparseForHTTP(String str)
This method reads a string and modifies it to support HTTP calls.
String result = "";
for (int i = 0; i < str.length(); i++) {
    switch (str.charAt(i)) {
    case ' ':
        result += "%20";
        break;
    case '<':
        result += "%3C";
...
StringparseLastfmUrl(String url)
parse Lastfm Url
if (url == null) {
    return null;
String parsed = url.replaceAll(".*?www.last.fm/.*?/", "");
parsed = parsed.replaceAll("/.*", "");
String decoded = null;
try {
    decoded = URLDecoder.decode(parsed, "UTF-8");
...
BundleparseUrl(String url)
parse Url
url = url.replace("rrconnect", "http");
url = url.replace("#", "?");
try {
    URL u = new URL(url);
    Bundle b = decodeUrl(u.getQuery());
    b.putAll(decodeUrl(u.getRef()));
    return b;
} catch (MalformedURLException e) {
...
BundleparseUrl(String url)
parse Url
try {
    URL u = new URL(url);
    Bundle b = decodeUrl(u.getQuery());
    b.putAll(decodeUrl(u.getRef()));
    return b;
} catch (MalformedURLException e) {
    return new Bundle();
ListparserTrackURL(String trackURL)
parser Track URL
List<String> list = new ArrayList<String>();
StringTokenizer st = new StringTokenizer(trackURL, "&");
while (st.hasMoreTokens()) {
    String url = st.nextToken();
    int index = url.indexOf("=");
    if (index > 0) {
        list.add(URLDecoder.decode(
                url.substring(index + 1, url.length()), HTTP.UTF_8));
...