Questions tagged [jobintentservice]

98 questions
3
votes
2 answers

Service also gets killed whenever App is killed in android pie

I'm learning Android programming by creating an android app. But whenever I kill the application service also gets killed. I'm using JobIntentService. To make that app work in the background. JobIntentService Class public class…
Creator
  • 303
  • 4
  • 23
3
votes
0 answers

ANR from a JobIntentService that is doing very little

I have a JobIntentService that is not doing a lot of work at all, but caused an ANR today. Is there anything wrong with calling code from the companion object in the following way? class MyIntentService : JobIntentService() { @Inject …
Tyler
  • 19,113
  • 19
  • 94
  • 151
3
votes
0 answers

JobIntentService not remove thread after finish like IntentService

I have JobIntentService from official doc: public class SimpleJobIntentService extends JobIntentService { static final int JOB_ID = 1000; static void enqueueWork(Context context, Intent work) { enqueueWork(context,…
purcha
  • 371
  • 3
  • 12
2
votes
0 answers

IllegalArgumentException with JobIntentService in Background

I am using JobIntentService to detect activities from the Google Activity Transition API. After an Update with Target SDK 30 (Android 11) I am receiving a lot of crashes in Crashlytics across all Android plattforms. They happen 99% in the…
2
votes
0 answers

Lot of crashes in my JobIntentService in JobParameters.completeWork method?

Since I started to use JobIntentService, which replaced IntentService post Android-Oreo, I started to have crashes in my console. It is not crash in my code, but in androix library (and also it can not reproduce them on my device, because it only…
qkx
  • 2,383
  • 5
  • 28
  • 50
2
votes
0 answers

How to perform multiple tasks one after another with JobIntentService

I want to add tasks to JobIntentService queue, currently i have created JobIntentService, which is working correct for one task, but when I call enqueueWork before finishing existing service , it is not working. Below is my JobIntentService public…
Shruti
  • 391
  • 1
  • 5
  • 21
2
votes
0 answers

TransactionTooLargeException when calling updateAppWidget in RemoteViews (on android 7.0 & 6.0 only)

I have lot of TransactionTooLargeException crash reports in console (interesting is - almost exclusively from older android versions 7.0 & 6.0 - pretty much none from newer androids). It happens always on this line of code in my…
2
votes
0 answers

What is the point of setting setInterruptIfStopped to true in a JobIntentService?

JobIntentService has the setInterruptIfStopped method which, when set to true, causes the currently running AsyncTask to cancel if the job is stopped: void setInterruptIfStopped (boolean interruptIfStopped) Control whether code executing in…
2
votes
1 answer

Unable to schedule Alarm using JobIntentService

I have been researching how to schedule an alarm targeting devices Oreo +. My current approach is using AlarmManager, a Ringtone service and broadcast receiver. I got the alarm to ring and display notification but the notification and the alarm does…
2
votes
1 answer

Home widget not refreshing on Oreo using JobIntentService

My app contains home widgets which are updated periodically using IntentService. Now, when targeting API level 26 I had to change this a little bit because of restrictions on Oreo. You can find more info here. I found this article in which it is…
2
votes
1 answer

Keep JobIntentService running with async task inside

I want to develop Text-To-Speech (TTS) feature in my app. It must be implemented inside Service, because user may leave "details" Activity and get back to "main" Activity or even leave my app, and it should still speak out loud text. Since Oreo…
snachmsm
  • 17,866
  • 3
  • 32
  • 74
2
votes
0 answers

Run FileObserver inside JobIntentService

My app runs a FileObserver inside a service (the service runs 10 minutes after a temp file is created, and it observes the file for 60 seconds in order to delete it if it's not used). Due to Android 8 restrictions, I cannot start a service from…
2
votes
0 answers

How to implement STICKY JobIntentService?

I have a framework that needs to be running in the background even if the app is closed from the Recents view. I implemented this initially as a Service that returns START_STICKY in the onStartCommand method. I am having doubts over returning…
John Ernest Guadalupe
  • 6,379
  • 11
  • 38
  • 71
2
votes
1 answer

Android Oreo location updates in background with JobIntentService

I used to have AlarmManager + WakefulBroadcastReceiver + Service to do some background code and get location updates. Since Oreo, this is deprecated, so now I use AlarmManager + BroadcastReceiver + JobIntentService. And this is code for the…
Ton
  • 9,235
  • 15
  • 59
  • 103
1
vote
1 answer

Best way get GPS Location in background for Android API level 30 and higher

My application determines the speed limit by the user's location and tells the user if he has exceeded it. Starting with Android API level 30 and higher, Google has defined IntentService as deprecated and suggests using WorkManager or…
Roman
  • 1,045
  • 1
  • 12
  • 33