I need to send one command to the server from an android activity at regular intervals of time and then receive the output and display it on the Layout of the activity.

How can I achieve the above task?