All Questions
Tagged with android-jetpack android-workmanager
126
questions
0
votes
0
answers
16
views
Start Multiple Work of the same type with WorkManager
I want to start multiple image caching work in parallel with WorkManager. It will be using CacheImageWorker class. The data is retrieved from external input. The codes will look like this:
val ...
0
votes
0
answers
151
views
How to force WorkManager to do work when app is NOT running?
I have a work that I want to run immediately when app starts running. but I'm only using Coroutines for that.
After app is killed I want to schedule WorkManager to continue that work. Is that possible ...
0
votes
0
answers
453
views
Logical solution for solve the WorkManager's Exception java.lang.IllegalStateException Data cannot occupy more than 10240 bytes when serialized
I'm trying to pass the String data(>10240 bytes) to the Worker class and process the data within that, as per the Developer documentation of Worker, if it's more than 10240 bytes that will throw an ...
2
votes
1
answer
1k
views
how do I access ViewModel inside Work Manager
I'm trying to access ViewModel using hilt inside the worker class which I created but unable to do so, can anyone help please?
0
votes
1
answer
37
views
executing task in a user defined time interval using work manager
I have a use case, in which I take input from the user of a time interval. For example, the user chooses 10 pm to 4 am. During this time interval, I want to basically track the screen time of the ...
3
votes
0
answers
519
views
Enqueued unique work with different input data with APPTND_OR_REPLACE but in worker resulted in same as what passed the first request
Component used:androidx.work/WorkManager
(androidx.work:work-runtime)
Version used:2.7.1
Devices/Android versions reproduced on: Android 10
I have enqueued many OneTimeUniqueWorkRequest with ...
2
votes
1
answer
819
views
Android WorkManager Network Constraint For Both Wifi and Data (Cellular)
I am learning WorkManager and wondering if following the correct way of setting network constraint for both Wifi and data (cellular):
val constraints = Constraints.Builder().run {
...
1
vote
1
answer
880
views
Unable to catch CancellationException in CoroutineWorker (WorkManager)
I am using a CoroutineWorker of WorkManager to download a long video. The download progress is shown in the notification along with an action to cancel the ongoing download. When the cancel action is ...
1
vote
2
answers
2k
views
Unable to update progress in ProgressBar of Notification using WorkManager
I want to create a long-running worker for downloading a video. As per my understanding, we should call createForegroundInfo() to update the ongoing notification. However, I can't find the information ...
0
votes
0
answers
974
views
android-execute a worker at roughly the same time every day
according to this medium article from Android Developers:
At the moment, if you need to execute a worker at roughly the same time, every day, your best option is to use a OneTimeWorkRequest with an ...
9
votes
2
answers
4k
views
Expedited WorkRequests require a ListenableWorker to provide an implementation for getForegroundInfoAsync()
Doing a little Jeopardy style Q&A here.
I have some work I sometimes need to run as expedited as described in the version 2.7.0 of WorkManager:
val constraints = Constraints.Builder()
....
0
votes
1
answer
454
views
Android - Looping worker for 1 minute
I've been searching for lots of articles about how to run a specific functions and methods within a certain time, for example, 5 minutes but I couldn't find at least a similar case with mine. Now, in ...
1
vote
1
answer
437
views
How to update timeInterval for PeriodicWorkRequest after doWork() call
I'm new to Work manager in android and I want to update the timeInterval of PeriodicWorkRequest once I got the response from server. Here is my sample code where I'm trying to update the timeInterval. ...
0
votes
1
answer
115
views
Testing WorkManager - RUNNING instead of ENQUEUED
I am following this example, but my test fails, since workInfo.state is RUNNING instead of ENQUEUED. Does anyone know what might be the issue? Please let me know if I should provide more code/context.
1
vote
1
answer
143
views
Schedule periodic local notification based on specific dates
I want to make a periodic worker to schedule notifications based on the total number of customer collection dates.
I already did apart, but I'm facing a problem.
Objective:
Check if there is a ...