I am a beginner of Android Programming, and when I learn something about Service ,the problem has become. We all know that the UI thread cannot run a long-time process, so we should run them in a new thread, and immediately ,we have recognised that something about Handler AsyncTask and Service even send a BroadCast when the task has been finished.However, I am not sure when to use them.
For example, we often using an activity to login, when the data should be posted, maybe post to the remote server, it may cost a long-time,we cannot write something in LoginActivity maybe in an AsyncTask or a Service to do that.But which is the better choice ?