How to pass string containing url in query string from android

view story

http://stackoverflow.com – 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) .appendQueryParame (HowTos)