android-workmanager

androidx.work.impl.WorkManagerInitializer: java.lang.ClassNotFoundException: “androidx.work.impl.WorkManagerInitializer” on path: /data/app/app-2.apk

别来无恙 提交于 2021-01-02 08:03:10
问题 I recently migrated my old app's background services to WorkManager. On recent devices (down to sdk 22 included ) it looks OK, running repeating work units and scheduling them even across device reboots as expected. The problem is when I test against old version (old is very relative here), Android sdk 14 which is my minSdkVersion . BTW also WorkManager should have the same: Backwards compatible up to API 14 according to doc. As stated in title, error I get is : java.lang.RuntimeException:

Why workers in work manager still in ENQUEUED state?

廉价感情. 提交于 2021-01-02 06:36:23
问题 I'm creating OneTimeWorkRequest with NetworkType.CONNECTED constraint, but even though the device is connected to the internet, the request is still in ENQUEUED state Constraints constraints = new Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build(); OneTimeWorkRequest request = new OneTimeWorkRequest.Builder(SyncWorker.class) .setConstraints(constraints) .build(); WorkContinuation continuation = mWorkManager.beginUniqueWork("work", ExistingWorkPolicy.KEEP, request);

How does WorkManager schedule GET requests to REST API?

两盒软妹~` 提交于 2020-12-29 02:57:18
问题 I've had a look at the codelab for WorkManager plus some examples on here, but everything in code I have seen is either related to doing work locally on the device or work uploading to the server, not downloading data and responding to the data received. In the developer guidelines it even says, "For example, an app might need to download new resources from the network from time to time," so I thought it would be perfect for this task. My question is if WorkManager can handle the following

How does WorkManager schedule GET requests to REST API?

北城以北 提交于 2020-12-29 02:56:48
问题 I've had a look at the codelab for WorkManager plus some examples on here, but everything in code I have seen is either related to doing work locally on the device or work uploading to the server, not downloading data and responding to the data received. In the developer guidelines it even says, "For example, an app might need to download new resources from the network from time to time," so I thought it would be perfect for this task. My question is if WorkManager can handle the following

How does WorkManager schedule GET requests to REST API?

点点圈 提交于 2020-12-29 02:56:32
问题 I've had a look at the codelab for WorkManager plus some examples on here, but everything in code I have seen is either related to doing work locally on the device or work uploading to the server, not downloading data and responding to the data received. In the developer guidelines it even says, "For example, an app might need to download new resources from the network from time to time," so I thought it would be perfect for this task. My question is if WorkManager can handle the following

Android Studio Work Manager Strange behaviour

吃可爱长大的小学妹 提交于 2020-12-13 11:19:39
问题 I have an application name com.example.xyz that is right now on the play store. I used Android studio Latest 4.0 to build it. After Serval days of testing what I notice that the Periodic work manager for android os 27,28,29 does not work if the app is killed from the background with and without proguard .The device tested was on one plus 7T and Nokia 5.1+ Later I build the same code with different application id name and on android studio 3.6. I found out the work manager was now working

Why I see: Unsatisfied constraints: CONNECTIVITY in JobScheduler debug info

风流意气都作罢 提交于 2020-12-10 13:25:56
问题 I set for the job: val job = JobInfo.Builder(2, ComponentName(context, JobRunner::class.java)).apply { setRequiredNetworkType(JobInfo.NETWORK_TYPE_UNMETERED) setRequiresBatteryNotLow(true) for (triggerUri in triggers) { addTriggerContentUri(JobInfo.TriggerContentUri(triggerUri, JobInfo.TriggerContentUri.FLAG_NOTIFY_FOR_DESCENDANTS)) } setTriggerContentUpdateDelay(TimeUnit.MINUTES.toMillis(1)) setTriggerContentMaxDelay(TimeUnit.MINUTES.toMillis(10)) }.build() jobScheduler.schedule(job) If I

Why I see: Unsatisfied constraints: CONNECTIVITY in JobScheduler debug info

旧时模样 提交于 2020-12-10 13:20:24
问题 I set for the job: val job = JobInfo.Builder(2, ComponentName(context, JobRunner::class.java)).apply { setRequiredNetworkType(JobInfo.NETWORK_TYPE_UNMETERED) setRequiresBatteryNotLow(true) for (triggerUri in triggers) { addTriggerContentUri(JobInfo.TriggerContentUri(triggerUri, JobInfo.TriggerContentUri.FLAG_NOTIFY_FOR_DESCENDANTS)) } setTriggerContentUpdateDelay(TimeUnit.MINUTES.toMillis(1)) setTriggerContentMaxDelay(TimeUnit.MINUTES.toMillis(10)) }.build() jobScheduler.schedule(job) If I

How to decrease time period of Workmanager Android?

走远了吗. 提交于 2020-12-10 12:42:53
问题 I have been checking with the other links, stackoverflow to reduce time period of Work manager, but I found below link How to reduce time of PeriodicWorkManager in WorkManager Above link says that minimum time is 15 minutes. Need to send data instantly from mobile to server. Is there any alternative for reducing the time period ? Please help me on this.Thanks in Advance. 回答1: In the work manager , there is a minimum time interval between two periodic requests is 15 minutes . Read this doc:

How to decrease time period of Workmanager Android?

心不动则不痛 提交于 2020-12-10 12:37:07
问题 I have been checking with the other links, stackoverflow to reduce time period of Work manager, but I found below link How to reduce time of PeriodicWorkManager in WorkManager Above link says that minimum time is 15 minutes. Need to send data instantly from mobile to server. Is there any alternative for reducing the time period ? Please help me on this.Thanks in Advance. 回答1: In the work manager , there is a minimum time interval between two periodic requests is 15 minutes . Read this doc: