posted 13 years ago
hi,
I decided to start learning Android with writing monitoring/management application that reads data from server socket. So far so good, but I believe I could have made a design error. I created service, that connects to server socket, reads data and broadcast it to activities (TabActivity). The application works fine, I get my data updated, but now I want to add extra funcionality of sending data from my device to server. To do so, I need to send data to socket = send data to service (where I have my socket connection opened).
I believe that it could be wrong way to do it? I mean to get somehow service instance from activity?
My question now is:
1. Is it ok I used service to create and keep my socket connection to server? If yes, how can now send data to service? If no, what should I use in such scenario then?
Thanks in advance,
Michal