I need to post string containing url to the server I have able to encoding the url but this will encoding whole string and I need to require only url link to be encoded and decode when get this data back to display in android.
mydomain/post.php?mesg=Hello%2Bhow%2Br%2Bu%250A%2BHttp%253A%252F%252Fwww.google.com%250A%250ATesting%2Burl
Edited
My code
String postStr = "Hello how r u?
http://www.google.com"; // suppose user entered string like this way
Uri.Builder builder = new Uri.Builder()
.scheme("http")
.authority(domain)
.path(pageName)
.appendQueryParameter("mesg", URLEncoder.encode(postStr, "utf-8"))
String urlStr = builder.build().toString();
After executing this getting this result
Hello+how+r+u%0A+Http%3A%2F%2Fwww.google.com%0A%0ATesting+url
And actual result want like this
Hello how r u?
http://www.google.com
Testing url
Thanks in advance