Questions tagged [android-workmanager]

Android Jetpack WorkManager is used for scheduling and managing one time and periodic background tasks.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Implementing Frequent(every 10 sec) API Polling in Android MVVM App with WorkManager for Learning Purposes

Question: I'm working on a simple Android MVVM app for learning purposes, where I need to fetch data from a REST API every 10 seconds, even when the app is killed. I understand that WorkManager has a ...
Sidharth's user avatar
0 votes
1 answer
24 views

The Android periodic WorkManager doesn't work

I want to run PeriodicWork with Dagger Hilt dependency injections. However, it doesn't work periodically. I have checked my code many times. There is at most only one message of a successful work ...
Евгений s's user avatar
0 votes
0 answers
13 views

What is the best way to schedule a job on android WorkManager, ScheduledExecutorService, AlarmManager

I need to run a service that upload files to the could. I want to let the user customize: At what times during the week If the upload should wait for wifi If the upload sould wait until the battery ...
Gil SH's user avatar
  • 3,789
0 votes
0 answers
10 views

CoroutineWorker locks UI only when starting and ending job

The UI freezes for a few milliseconds only when starting and ending work. After that I have no problems, when I close the application it still works and everything works perfectly. The only detail or ...
looko jhansa's user avatar
0 votes
0 answers
13 views

Execute a periodic worker when the device is switched on

I am developing a news reader based on a RSS feed. So far I created: a worker to retrieve the feed and convert it to a list of objects, so I can show it on a listview; a periodic worker which is ...
user1012480's user avatar
0 votes
0 answers
9 views

What is the best way to show information about current Work progress in UI?

I have a CoroutineWorker which does some background work. I need to display in UI some information from this worker: Current step Progress (%) Error information (exception details) What is the best ...
Solvek's user avatar
  • 5,180
0 votes
0 answers
17 views

What should I use to Listen for incoming calls services in Android or work manager of Android?

I am developing an application that needs to monitor incoming calls continuously, even when the app is not active. Initially, I implemented this functionality using broadcast receivers and services in ...
Shivam Gupta's user avatar
0 votes
0 answers
27 views

Flutter workmanager package does not execute tasks in when the device goes in idle or doze mode

I am using WorkManager package in Flutter to run code in background. The scheduled task runs perfectly when the mobile is not off or I am using phone. But as soon as the mobile enters idle or doze ...
Adnan's user avatar
  • 11
1 vote
1 answer
31 views

Is it possible to run a job on the main thread using WorkManager on Android?

We are using an SDK that requires calls to be made on the main thread. For a Worker that needs to run in the background once a day using WorkManager, I have set: @HiltWorker class MyWorker @...
Rowan Gontier's user avatar
2 votes
3 answers
213 views

foregroundServiceType 0x00000001 is not a subset of foregroundServiceType attribute 0x00000000 in service element of manifest file

I have implemented Foreground Service using WorkManager, it works fine upto API Level 33. Since it is mandatory in API Level 34 to specify foregroundServiceType, I specified it in Worker and in the ...
Saif's user avatar
  • 21
0 votes
1 answer
44 views

show Notification of Workmanager only when app is not in foreground

I have a long-running worker using WorkManager library. As soon as the worker starts, a notification must be shown(?). But I don't want to show the notification when app is in foreground. Is there a ...
mrzbn's user avatar
  • 527
0 votes
2 answers
48 views

How to make persistent process that continues after app being killed in Android?

I have a process in my android app that does some calculations and saves its result to cache. It takes approximately 10 seconds and it is started after application launch. The problem is when user ...
Spiros's user avatar
  • 1
0 votes
1 answer
31 views

Launch a service after device is unlocked/rebooted with API level > 26

I want to create a simple service on Android 13 that will do a task after the user unlocks the device. I found different ideas on StackOverflow but most of them target the API 25 or bellow. Since then,...
tinyestgrape's user avatar
1 vote
1 answer
22 views

Android work manager factory returning only one type worker

I had 2 workManager workers in my app. I added a new worker for DB operation DatabaseSyncWorker. The Database sync worker needed an extra parameter as part of DI. So I created a workerFactory class to ...
Droidme's user avatar
  • 1,223
0 votes
1 answer
31 views

workManager vs alarmManager vs fcm for scheduled notifications

i have a use case: we have information about user's medications like at what time ,what dose and what med, we need to notify users that they have to take it. currently, I have tried workmanager , gets ...
Jagnath reddy's user avatar
0 votes
0 answers
75 views

How to solve Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR) in android app?

I am getting below error and app crashes while uploading a video as chunks in my app. I have a OneTime Work Manager created to handle the chunking and upload of video. Every time when it reaches 151th ...
Droid's user avatar
  • 57
0 votes
0 answers
28 views

develop a function in kotlin using WorkManager + Socket

it's for college work, I worked as an uber driver for a while and I took on the challenge of developing the function of that driver button to trust online, which after online it receives a ride and if ...
Dalva 's user avatar
0 votes
0 answers
31 views

Ffmpeg not working in background when target SDK updated to 33

I am using FFMPEGKit library in my android project. (https://github.com/arthenica/ffmpeg-kit). After updating the targetSdkVersion of my android app from 31 to 33, the compression feature stopped ...
Rahul Vyas's user avatar
  • 28.3k
1 vote
2 answers
297 views

Gradle | Android | Duplicate class androidx.work issue | androidx.workmanager

Execution failing when trying to build, Below is the error Execution failed for task ':app:checkReleaseDuplicateClasses'. A failure occurred while executing com.android.build.gradle.internal.tasks....
Rohitb's user avatar
  • 11
0 votes
1 answer
36 views

How to schedule notifications in Kotlin for android with a time array?

Hi I want to schedule notifications with a notification array: val timesArray = arrayOf("5:45", "17:58", "13:57", "13:58") Whats the best way? Using ...
Auryn Vansteenkiste's user avatar
0 votes
0 answers
14 views

Can I use FirebaseMessagingService to request single location update and make network request?

I have a FirebaseMessagingService: class MyFirebaseMessagingService : FirebaseMessagingService() { override fun onMessageReceived(remoteMessage: RemoteMessage) { super.onMessageReceived(...
nutella_eater's user avatar
2 votes
1 answer
445 views

Android Studio App Inspection don't start : Could not launch inspector *.inspection: Failed during instantiating inspector with id *.inspection

I got a big problem... The App Inspection of Android Studio don't start even after clearing caches, restart/delete AVD. Steps done: Clear Caches Update All Delete/Recreate AVD Read All The Logs When ...
HSMKU's user avatar
  • 89
0 votes
0 answers
34 views

ListenableWorker's onStopped() gets called unexpectedly while executing code

Short Story : I have a ListenableWorker that performs tasks involving fetching data from a local database and performing checks with this data. However, I have noticed that the onStopped() method of ...
shadygoneinsane's user avatar
0 votes
0 answers
66 views

Implementation of Work Manager-like work scheduling for Kotlin Multiplatform

how can I implement workmanager like work scheduling in multiplaform the intent is to develop offline first desktop app with compose desktop the logic would be done implemented (i tried store 5 and it ...
ayitinya's user avatar
0 votes
1 answer
112 views

How to update UI from work manager on relaunch of app

I am using WorkManager in my app to upload big videos to server. First I make chunks of video file and then upload through work manager. I need to show the progress of upload on UI, and Work manager ...
andro-girl's user avatar
  • 8,031
0 votes
1 answer
47 views

OOM in CoroutineWorker when doing Bitmap operations

I am trying to run some work for a set of files (~2000), and I need to decode some, so it takes a lot of memory. If I am 'doing work' like that: override suspend fun doWork(): Result { (0...2000)....
StayCool's user avatar
  • 421
0 votes
0 answers
26 views

Work manager and Location updates best practice

I'm trying to get some location updates and save them to the database. My problem is that sometimes it works, sometimes it does not. What I do now is I start a Work Manager like this: val ...
nutella_eater's user avatar
2 votes
0 answers
183 views

Workmanager with Kotlin Multiplatform Mobile

I want to call a method in from CommonMain periodically even when the app is in background. I wanted to start to implement it for Android, so I tried with Workmanager. But I realised that I cannot ...
basti394's user avatar
  • 189
2 votes
1 answer
41 views

Error: Could not activate JNI Handle - WorkManager implementation in Xamarin

I've been trying to implement the WorkManager (https://developer.android.com/topic/libraries/architecture/workmanager/) in .NET using Xamarin (porting old code where we used jobscheduler). On booting ...
Ace's user avatar
  • 53
0 votes
0 answers
39 views

Prepopulate Room database with Worker Hilt

I'm trying to prepopulate a Room database using a Worker injected by Hilt in the RoomDatabase.Callback(), but when I open the app and the first call requires data, it happens that returns an error and ...
Barros's user avatar
  • 84
0 votes
1 answer
108 views

CoroutineWorker not showing up correctly in Android Studio's "Background Task Inspector"

I am calling several CoroutineWorker classes in my Android application. In the past, I could easily watch details for each worker execution in the "Background Task Inspector" of Android ...
user1163881's user avatar
0 votes
0 answers
20 views

Using Socket in Android application for non-google certified devices

I am working on an application for a non-google certified device which means it doesn't have google play services or FCM, I am trying to implement push notifications using Socket. I have already ...
Mohamd Ali's user avatar
  • 2,156
1 vote
1 answer
45 views

Does WorkManager.updateWork() need the full config or can it be partial?

It's not clear to me from the docs and guidance whether the WorkRequest passed to updateWork() (or to enqueueUniquePeriodicWork() with policy ExistingPeriodicWorkPolicy.UPDATE) must provide a full ...
drmrbrewer's user avatar
  • 11.5k
0 votes
2 answers
129 views

Android WorkManager: PeriodicWorkRequest is not executing or its executed once

I'm implementing a class for a background tasks using workmanager. The task is periodic so I'm using PeriodicWorkRequest, but task is not exectuing or its executed once. Here is class, what is wrong ? ...
soyunewok's user avatar
  • 115
0 votes
0 answers
89 views

Android Workmanager: "You have explicitly disabled WorkManagerInitializer in your manifest...."

I use workmanager in appwidget with a separate process, <receiver android:name=".todo.calendar.appwidget.ScheduleWidgetSmall" android:exported="true&...
junWen's user avatar
  • 1
1 vote
2 answers
98 views

BluetoothLeScanner running in a background worker class works on Android 9 device but does not work on Android 13 device

I use jetpack WorkManager to schedule a BLEScanWorker class to scan for BLE devices in the background every 15 minutes. BLEScanWorker scans BLE devices for 10 sec each time and saves the discovered ...
user22020238's user avatar
0 votes
0 answers
13 views

How to schedule another instance of a worker with the same unique name when the worker has finished, using WorkManager?

I have a task that needs to run once at the end of every month approximately at 00:00. I have implemented it in the following way: fun schedule(existingWorkPolicy: ExistingWorkPolicy) { val ...
hoshiKuzu's user avatar
  • 876
0 votes
0 answers
30 views

How can I send the data I get from the api with workmanager as a notification?

My Worker Class class NotificationWorker( private val context: Context, params: WorkerParameters, ) : CoroutineWorker(context, params) { private val viewModel: QuoteSunshineViewModel by ...
Yusuf Talha Kılıç's user avatar
0 votes
0 answers
26 views

How do I push notification the data I get from the api?

I'm pulling data from api using viewmodel and I want to push notification every hour, how can I do that?
Yusuf Talha Kılıç's user avatar
0 votes
0 answers
27 views

Best way to implement a functionality that reads data every second in the background

I am currently rewriting/updating the app that had a background service that was reading CAN data and processing it. Data is being updated every second and it is either stored or if the value meets ...
Chris's user avatar
  • 1
0 votes
0 answers
12 views

How do I invoke a function within a launcher fragment before a worker returns Result.Success()?

I have a launcher fragment that displays a list of applications; before my worker returns the Result.Success(), I need to invoke a function within that fragment I attempted to communicate with a ...
Kenny Roy Elphej's user avatar
0 votes
1 answer
191 views

Kotlin: Could not instantiate CouroutineWorker (java.lang.NoSuchMethodException)

I'm trying to add periodic (daily) notifications to my app with a different title pulled from a Room DB based on the current date. I'm using Dagger-Hilt and Jetpack compose. This is the error that ...
zkvvoob's user avatar
  • 396
0 votes
1 answer
42 views

Periodic work isn't enqued after several successful executions

I'm scheduling a periodic work with Android's WorkManager (using androidx.work:work-runtime-ktx:2.8.1). After several successful executions, the periodic work stops being executed. The task I'm ...
guy.gc's user avatar
  • 3,369
0 votes
0 answers
76 views

WorkManager worker not running every hour

I've created a worker that should run each hour: val workRequest = PeriodicWorkRequestBuilder<MyWorker>(1, TimeUnit.HOURS) .setConstraints( Constraints.Builder() ...
stefan.at.kotlin's user avatar
0 votes
1 answer
30 views

How initial delay counting in chaining works?

When initialDelay will start counting in this case: individual for each request or common? val triggerRequests = triggers.map { OneTimeWorkRequestBuilder<TriggerWorker>() ....
Viewed's user avatar
  • 1,119
0 votes
0 answers
20 views

Can't import some libraries in android

I implemented volley library (implementation 'com.android.volley:volley:1.1.1') but when I try to write StringRequest in MainActivity it doesn't import. I had the same problem with Manager ...
Afgan Gadirov's user avatar
1 vote
0 answers
422 views

WorkManager: is there a way to see the constraints that were specified for a WorkRequest?

The title says it all: I want to be able to see which constraints were specified for a specific WorkRequest, after work execution had already begun. This sounds like a basic functionality, yet I've ...
Vasiliy's user avatar
  • 16.2k
1 vote
0 answers
51 views

Android WorkManager setRequiredNetworkType Wi-Fi vs Cellular

New to Android development and, in using WorkManager for the first time, I’m also employing setRequiredNetworkType(NetworkType.CONNECTED) in my Constraints to make certain an Internet connection is ...
Bink's user avatar
  • 1,954
1 vote
0 answers
68 views

AlarmManager and Broadcast not triggering notification after 24 hours

I'm developing an app that list upcoming movies and allows the user to create a reminder for a specific upcoming movie. Once the user click on the reminder button of a movie the app should schedule 3 ...
r96's user avatar
  • 33
0 votes
0 answers
12 views

How to update a running CoroutineWorker?

I have a CoroutineWorker worker that uploads files to server. I want to be able to pause it and resume it when user clicks on button without closing the Worker. I read that one can use the updateWork()...
Uriel Frankel's user avatar

1
2 3 4 5
27