On Android, background execution is unpredictable.
Google's official background processing library, WorkManager , is designed to be resilient: it guarantees that scheduled background tasks will eventually execute, even if the user reboots their phone, kills the app, or travels through cellular dead zones.
However, in achieving that resilience, WorkManager makes an important operational compromise:
WorkManager guarantees at-least-once execution, not exactly-once execution.
If an Android device experiences an aggressive OEM battery kill (common on Samsung, Xiaomi, or OnePlus devices), or if the OS restarts during a task, WorkManager may fire the same background worker two, three, or four times in rapid succession .
Now consider what happens in personal finance:
What if your background worker posts recurring monthly rent of Rs.…