Hello i have a little problem with writing the words in the database, after some space between the words the database can't remember it, thats why because the link eg. ( /some_file.php?search=something%20wierd ) that "%20" its the space between the words but from my mobile application when ill type space doesnt write it into the database... what should i do ? :/
Also i want to give message "You are not connected to the Internet" if is true...
public static String sendSearch(String search) throws Exception {
URL url = new URL("http://secretchatsk.host56.com/some_file.php?search="+search);
URLConnection conn = url.openConnection();
InputStream stream = new BufferedInputStream(conn.getInputStream());
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
String line;
StringBuilder sb = new StringBuilder();
while ((line = reader.readLine()) != null) {
sb.append(line);
}
reader.close();
return sb.toString();
}
Thank You ! :)