java - AsyncTask vs Thread vs Service (communicating with server) -


I'm trying to apply an Android app where I can send commands to a server that controls the robot The problem is quite "simple": I want to keep a connection to send a message to the server and communicate with thread-service-work, and to get the responses to update the user and keep the information related to the robot sensor. Want to .

So, what should my decision be? I know it may have been repeated but I did not find my problem, because I want to expand this question:

Whether to run a background process on an activity, change the activity and continue it Any way? (activity or piece, I would go for pieces in the future).

Thanks in advance for any help!

Its best solution is probably a service

Either how to communicate with the background service through intents or broadcast events, a great article on services.

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -