You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Its API is quite similar to that of the JetPack WorkManager API so I assume that you guys consciously decided not to use it, but to provide an own implementation. If this decision is already documented somewhere, could you point me there?
Otherwise I'd like to propose to use the Jetpack/androidx implementation, which is Google's official recommendation for doing periodic background work. It relies on sophisticated decisions made by the OS to optimize, when the best moment is to launch background tasks. E.g. one can set certain constraints to schedule the work only when the device is online, or if it's not low on battery (which is what I would recommend to set by default).
If I understand it correctly, it would work with the current minSdk (21), see the androidx.work docs:
WorkManager uses an underlying job dispatching service when available based on the following criteria:
Uses JobScheduler for API 23+
Uses a custom AlarmManager + BroadcastReceiver implementation for API 14-22
The downsides I can think of:
I find it difficult to pass object references between Work objects and the rest of the code.
I have stumbled upon the custom
PeriodicWork
implementation in the project, which is used by the disk buffering implementation to export signals:opentelemetry-android/services/src/main/java/io/opentelemetry/android/internal/services/periodicwork/PeriodicWork.kt
Line 21 in 7238ac4
Its API is quite similar to that of the JetPack WorkManager API so I assume that you guys consciously decided not to use it, but to provide an own implementation. If this decision is already documented somewhere, could you point me there?
Otherwise I'd like to propose to use the Jetpack/androidx implementation, which is Google's official recommendation for doing periodic background work. It relies on sophisticated decisions made by the OS to optimize, when the best moment is to launch background tasks. E.g. one can set certain constraints to schedule the work only when the device is online, or if it's not low on battery (which is what I would recommend to set by default).
If I understand it correctly, it would work with the current
minSdk
(21), see theandroidx.work
docs:The downsides I can think of:
Work
objects and the rest of the code.WorkManagerInitializer
things get dirty very quickly.The text was updated successfully, but these errors were encountered: