Service:
- Task with no UI,but should not use for long Task. Use Thread within service for long Task
- invoke by onStartService()
- Triggered from any Thread
- Runs On Main Thread
- May block main(UI) thread
IntentService
- Long task usually no communication with main thread if communication is needed then it is done by Handler or broadcast
- invoke via Intent
- triggered from Main Thread (Intent is received on main Thread and worker thread is spawed)
- runs on separate thread
- can’t run task in parallel and multiple intents are Queued on the same worker thread.
No comments :
Post a Comment