• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Endless Background Service In Android Ore or More

sodais

Lurker
Hi,

I have been trying to make an application which actually works pretty well in Android less 26 but after 26 means Android Oreo or more the OS just kill my background service i have tried to done this job with JobSheduler , Foreground Services , AlarmManager but nothing seems to be working fine i want some thing that never ends because i am making a application which is kind of GPS application which will be sending the location after every 5 minutes please help.
 
Hi,

I have been trying to make an application which actually works pretty well in Android less 26 but after 26 means Android Oreo or more the OS just kill my background service i have tried to done this job with JobSheduler , Foreground Services , AlarmManager but nothing seems to be working fine i want some thing that never ends because i am making a application which is kind of GPS application which will be sending the location after every 5 minutes please help.

I believe what you need is the JobIntentService. This class replaces the IntentService for API 26+. To make it compatible with API 25- you need to add the WAKE_LOCK permission in the manifest.

Here's the documentation:
https://developer.android.com/reference/android/support/v4/app/JobIntentService

There's plenty of tutorials online on how to use it.
 
If you don't mind do you have an example code or some thing like that for that work instead documentation.
It will be a big help.

I wrote a tutorial that demonstrates how I use a JobIntentService with fully working example project and code here:
https://techstop.github.io/android-broadcastreceiver/

Now here's the thing, there are different ways to use this service, so the example a linked above may not be what you're looking for. If not do a google search for "how to use jobintentservice" and plenty of tutorials will come up.
 
Back
Top Bottom