There is a client-server system. Client on android server on Delphi. Everything basically works, click on the button, the message is read from edit and sent. The question is how to make the message sent not once, but constantly, until I release the key. Here is the code to send the message:
public void onClick3(View view) { try { EditText et = (EditText) findViewById(R.id.editText3); String str = et.getText().toString(); PrintWriter out = new PrintWriter(new BufferedWriter( new OutputStreamWriter(socket.getOutputStream())), true); out.println(str); } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }