Warum kommt der Fehler java.net.MalformedURLException: no protocol: http%3A%2F%2Fwww.mal ..... usw.
müsste doch eigentlich korrekt formatiert sein
public void sendToServer(final String text) {
try {
String servertext=server + text;
System.out.println(servertext);
String textparam = URLEncoder.encode(servertext, "UTF-8");
URL scripturl = new URL(textparam); //<--- FEHLER HIER
HttpURLConnection connection = (HttpURLConnection) scripturl.openConnection();
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setFixedLengthStreamingMode(textparam.getBytes().length);
müsste doch eigentlich korrekt formatiert sein
public void sendToServer(final String text) {
try {
String servertext=server + text;
System.out.println(servertext);
String textparam = URLEncoder.encode(servertext, "UTF-8");
URL scripturl = new URL(textparam); //<--- FEHLER HIER
HttpURLConnection connection = (HttpURLConnection) scripturl.openConnection();
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setFixedLengthStreamingMode(textparam.getBytes().length);