Originally answered on Quora: "Why does my Android camera stop recording when the screen turns off, and how do I keep it running?" (Super Funicular, 2026-05-21). This is the dev.to canonical — the long, mechanism-level version of the same answer, written for developers shipping a camera-adjacent Android app and for owners who want to understand the OS behavior before, or instead of, writing code.
If you've ever set your Android phone down as a home security camera, locked the screen, and walked away — only to discover later that the recording stopped fifteen minutes after you left — you've met the real adversary of Android background recording: Doze Mode. Not the camera API. Not the codec. Not the storage. Doze.
This is the question-the-mechanism essay. It explains why Android stops your camera the moment the screen turns off, what the levers actually are (at the OS layer, at the app layer, and at the user-settings layer), and — for the developers reading — why WorkManager, the API that every modern Android tutorial reaches for first, is the wrong tool for this specific job. WorkManager is a fine tool. It is just a fine tool for a different problem.
I'm the developer of Background Camera RemoteStream (https://play.google.com/store/apps/details?id=com.superfunicular.digicam&utm_source=devto&utm_medium=article&utm_campaign=2026w22) — a free, no-cloud, no-account Android app that records continuously with the screen off and streams the live feed to any browser on your home Wi-Fi via an embedded web server. I have spent a long time inside this problem. The Camera2-specific architecture writeup is here: How to Keep the Camera Running with the Screen Off on Android. This piece is the why, the broader OS-mechanism tour the architecture piece presupposes.













