I would like to make a kind of form with this code by sending "string_ship" but I can not get it to write it in the file.
public void envio_formulario(View v){
String nombre=et_nonm.getText().toString();
String telefono=et_telf.getText().toString();
String email=et_email.getText().toString();
String comentario=et_coment.getText().toString();
cadena_envio="Nombre: "+nombre+" Email: "+email+" Telefono: "+telefono+" Comentario: "+comentario+"\n";
Toast.makeText(this,cadena_envio,Toast.LENGTH_LONG).show();
Thread hilo_escribe = new Thread(new Runnable() {
public void run() {
try{
URL url = new URL("http://radios-android.000webhostapp.com/formulario.txt");
URLConnection urlConnection = url.openConnection();
OutputStream is = urlConnection.getOutputStream();
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(is));
bw.write(cadena_envio);
bw.close();
}catch (Exception e){}
}
});
hilo_escribe.start();
try{
hilo_escribe.join();
}catch (Exception e){}
}
}