Android Service or IntentService for app like whatsapp? -


i developing chat app. when user connects internet, server pushes message notifications him.

should use service or intentservice new message notifications? service/intentservice must start on boot , never stop, if close app.

i expect if using own push notification system, it's based on keeping connection/socket open backend. you'll have on background thread because android doesn't allow network operations on main thread.

intentservice queues start commands (issued via context.startservice()) , executes them serially on background thread; once queue exhausted stops automatically. useful performing relatively short-lived tasks off main thread , in context less erratic lifecycle activity. doesn't sound best fit must alive, think should stick regular service , manage own worker thread keep network operations in background.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -