i have made a java server and java client programms that communicate with TCP sockets sending String messages. Those java programs work perfectly. The client logic is that it has a UI and a thread, which is waiting all the time for new messages and updates the UI accordingly what message it recieved (e.x. add buttons,set buttons visible, change texts).
Now, im totally new to android and i want to make an equal client for android but i faced those problems:
1) I can't update the UI from a background thread just passing parameters(like java).
2) I want that one thread to update 2 or 3 Activies(i need 2-3 because the lack of screen space)
I have read about AsyncTask but they say it is recommended for sort tasks, then i read about threads with handlers but they say is difficult to work with and i got confused. So my question is what method should i use on android to achieve that "message listener/UI updater" thread.
UPDATE: Ok, i used threads and handlers and my main activity got updated, but now how i can update the second Activitie from that thread too??