How can I make my android application run in background

Osama Naveed picture Osama Naveed · Dec 18, 2015 · Viewed 19.6k times · Source

I have developed an application which take image from front camera after every 30 seconds. When I press the back button my application stops. I want to run my application in background and I have no idea how to do it. Any help will be appreciated..

Answer

Navdeep picture Navdeep · Dec 18, 2015

You can use an IntentService. It runs on a background thread and is not affected by UI lifecycles. You can reach about how to use it here in the Android Developer Docs