I have a server that runs on Amazon ec2, which listens to a socket and prints the message ("hello world") sent by the client - which is an activity (android app).
I'm trying to send messages from the activity to the server in a function, for example: after a button is clicked to send the server a message that a button was clicked. I created a connectionHandler class which extends a thread and handle the connection to the server and writes the "hello world" message. I want to create a function called "send" that receive a string, that an activity can call it and the message will be passed to the server.
My connectionHandler is a thread, so when I start it, it just execute the run() function, and once it finished I cannot call other functions to send messages.
I hope I was clear with my question,
Thanks, Itai.