I encoded the IntentService where I am sending the command line. Associated with the activity in which I am trying to program the console. The purpose of the action is to execute a "command line" where I can send and receive to / from the server.
Service Action:
- CONnect to the server
- Send command line
- Get an answer
- Get response to user
The main problem is that every time I send the command line, the Service must reconnect to the server. (The reason every time the whole service starts) How can I avoid this step?
I would like to “support” a service that is waiting for a command line to be sent without having to reconnect every time I perform its action.
Is there a way to make this responsive? I mean, I start the service and every time I set its action (setAction), and put the line I want (putExtra). Then do I need to start the service again?
Good night. I'll be back tomorrow :)
Thanks in advance!
source share