ARTICLE AD BOX
I am currently developing an Android application with Kotlin and Jetpack Compose that should repeatedly (~once per minute) collect some information about my phone (battery, temperature, current network connection status) and upload that, when online, to a server. This should, of course, happen independently of whether or not the screen is on, and, ideally, persist between device restarts and OOM-killings.
Android offers mutiple ways to 'do things in the background', of which I have, so far, come across
WorkManager with a PeriodicWorkRequest (runs at most once per 15min)
JobScheduler with JobInfo.setPeriodic
a background Service (subject to system limitations)
AlarmManager
(here, 'the background' just means the screen needn't turn on and the app needn't open, i.e. WorkManager is still an option)
I do not care about battery consumption or backwards compatibility (with version below Android 16).
Which of these features (or which other feature, or which combination of features) should I use to make this app send data to the server regularly in the background?
