Questions tagged [jobservice]

110 questions
1
vote
0 answers

NativeScript JobScheduler JobService.class is undefined

I have weird error while i'm trying to create component in the JobScheduler At the first line when setting a component value i get this error: ERROR TypeError: Cannot read property 'MyJobService' of undefined Both of the files are in the same…
Johnny
  • 105
  • 2
  • 14
1
vote
1 answer

JobScheduler-NETWORK_TYPE_NONE gives IllegalArgumentException

I am using below code to schedule a job service. JobScheduler jobScheduler = (JobScheduler) mContext.getApplicationContext().getSystemService(Context.JOB_SCHEDULER_SERVICE); if (jobScheduler != null) { try…
1
vote
1 answer

JobService does not repeat

In Android Oreo, I want to create a service that periodically updates data from the network. class NetworkJobService : JobService() { override fun onStopJob(p0: JobParameters?): Boolean { jobFinished(p0,true) return true } override fun…
H.Kim
  • 525
  • 4
  • 14
1
vote
2 answers

JobScheduler onStartJob gets delayed once application gets killed

I am not getting why service onStartJob not calling with given time which mentioned in setOverrideDeadline(2000). I am scheduling job like: private void scheduleJob() { JobInfo myJob = new JobInfo.Builder(0, new ComponentName(this,…
Jitesh Mohite
  • 31,138
  • 12
  • 157
  • 147
1
vote
1 answer

Dependency injection in a scheduled JobService with Dagger 2

What's the best way to inject dependencies in a scheduled jobservice in Android. My JobService is scheduled to run in the night to do some stuff. In JobService constructor i'm trying to inject my dependencies over my Application…
Thomas Meinhart
  • 659
  • 2
  • 7
  • 28
1
vote
0 answers

Why does the Xamarin Forms Android Job Scheduler nor respect the schedule

I'm using the latest Xamarin Forms 3.1.0 and I'm trying to schedule a daily send of information back to the server. I'm using the JobSchedulerService with SetPeriodic(24 * 3600 * 1000) which references the JobService below. This starts and runs ok…
Nick Jones
  • 131
  • 1
  • 7
1
vote
0 answers

Unable to make use of JobInfo.NETWORK_TYPE_CELLULAR in JobService

In our app, we want to bifurcate Wifi and Cellular related calls. We have set the target to 28. The code looks like below for scheduling cellular based. But, we are unable to set NETWORK_TYPE_CELLULAR. ComponentName componentName = new…
shakunthalaMK
  • 386
  • 1
  • 4
  • 20
1
vote
0 answers

Job service causes parser error in Android Xamarin

I need to download some files in the background for which i used the job service . When i tried to deploy the application in android device version 7.0, an error occur saying "There was a problem while parsing the package". Here is my code public…
Subrak
  • 139
  • 11
1
vote
0 answers

Job scheduler not repeating its job on give time in android

Actually in android want to run my job after 1 minutes whether app is active or not but it runs my job after around 3,4 minutes which I don't want please give me suggestion how can I run it according to my given time. Thanks in advance. Here is my…
1
vote
1 answer

Scheduling JobService to run only when app is running (on foreground)

I need to do some background updates (about every 1 min). I have to use JobService to do it periodically. But I don't need to run service when app is closed - only when app is running (on foreground). Is there is a way to do that?
Victor Kochetkov
  • 221
  • 2
  • 13
1
vote
0 answers

JobScheduler: using AsyncTask does not end up calling doInBackground

Kotlin and Android rookie here... I'm trying to create a job but I'm having some trobule gettint my async task to run. Here's my JobService: class DbUpdaterJob: JobService(){ private var activityMessenger: Messenger? = null private var isWorking =…
Luis Abreu
  • 4,008
  • 9
  • 34
  • 63
1
vote
0 answers

Correct way to use JobService to start a Service

I'm building a JobService. This JobService should to start a service every 5 seconds. But if the Service is already running I shouldn't start it. Now this is my JobService: public class BleJobService extends JobService { JobParameters params; …
bircastri
  • 2,169
  • 13
  • 50
  • 119
1
vote
1 answer

How to set a maximum time in jobInfo so that the job will be canceled after this time?

I have a jobService schedule a job JobInfo.Builder builder = new Builder(JOB_ID); builder.setBackoffCriteria(/*initial 3 min*/ INI_TIME, /*increase exponential*/…
Pineapple
  • 111
  • 1
  • 4
1
vote
2 answers

Firebase job dispatcher does not trigger my JobService class when running code on my real time device, why?

I am working on a project that uses firebase job dispatcher to schedule a job that runs on intervals. But the thing is, I ran the code on the android studio emulator and it worked just fine. The job was scheduled and I received a toast from the…
1
vote
0 answers

Using JobScheduler instead of MQTT

I am working an app that using Mqtt and I m trying to introduce Jobservice instead of Mqtt Service. Can do this for long-running Background Services in Android Oreo? Here is my code. @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public class…
mery.lf
  • 51
  • 3