You can use a while(true) to indefinitely keep sending the message and then use thread.sleep if you want to take few second breaks between sending a message. Using thread.sleep will freeze your whole UI during the amount you entered so you can run that as a background task or on a different thread.