Android URL Encode encodeURL(String value)

Here you can find the source of encodeURL(String value)

Description

encode URL

Declaration

public static String encodeURL(String value)
            throws UnsupportedEncodingException 

Method Source Code

//package com.java2s;

import java.io.UnsupportedEncodingException;

import java.net.URLEncoder;

public class Main {
    public static String encodeURL(String value)
            throws UnsupportedEncodingException {
        if (!isEmpty(value)) {
            return URLEncoder.encode(value, "UTF-8");
        }/*from w  w  w.j a  v a 2 s  . com*/
        return "";
    }

    public static boolean isEmpty(String value) {
        return value == null || value.trim().equals("")
                || value.length() == 0;
    }
}

Related

  1. encode(String value)
  2. encodeURI(String encoded)
  3. encode(String base)
  4. encode(String url)
  5. urlEncode(String url)
  6. urlEncode(String string)
  7. getURLEncodeStr(String url)
  8. getUrlCode(String pageUrl)
  9. urlEncode(String in)