Android PlatformUpdated April 2026

Android foreground services,
the backbone of live experiences

Foreground services are how Android keeps live work running — navigation, music, calls, ride tracking. They are paired with ongoing notifications and form the Android equivalent of an iOS Live Activity under the hood.

Quick answer

A foreground service (FGS) is an Android Service the system promises to keep alive while it is running, in exchange for the user seeing a persistent notification. Every “live” Android experience — navigation, audio, calls, fitness tracking — is built on a foreground service plus an ongoing notification.

What Is a Foreground Service?

Android Services are background workers. Most are killable at any moment when the system needs memory. A foreground service is special: it must declare a user-facing reason for running, show a persistent notification, and in return gets a strong guarantee that it will not be killed casually.

Foreground services are the backbone of any live experience on Android. They keep location updates flowing for Maps, audio playing for Spotify, the call connected for WhatsApp, and the upload running for Drive.

The Foreground Service Types

Since Android 10 (mandatory in Android 14+) you must declare a type for every foreground service. Each type ties to specific runtime permissions and use cases.

location

Continuous location updates. Requires ACCESS_FINE_LOCATION + FOREGROUND_SERVICE_LOCATION.

mediaPlayback

Audio/video playback. Pairs with MediaStyle notifications.

dataSync

Uploads/downloads/sync. Time-bounded on Android 15. Use WorkManager for periodic.

phoneCall

In-progress voice/video calls (CallStyle).

camera

Continuous camera access from background (e.g. dashcam, video conferencing PIP).

microphone

Continuous microphone (e.g. dictation, voice assistants).

mediaProjection

Screen-recording / casting. User must approve via projection prompt.

health

Workout sessions, continuous heart-rate monitoring (Health Connect related).

remoteMessaging

Long-lived messaging connections (e.g. enterprise IM clients).

shortService

Quick task <= 3 minutes that does not need a typed permission. Auto-stops after the timeout.

systemExempted

Reserved for system / OEM apps with the role.

specialUse

Catch-all for valid cases that do not fit any other type. Requires Play Store justification.

How to Start a Foreground Service

1

Declare in the manifest

<service android:name=".MyService" android:foregroundServiceType="location|mediaPlayback" /> and add the matching FOREGROUND_SERVICE_* permissions.

2

Start with the right API

startForegroundService(intent) from an allowed context (typically a user-initiated action). The service must call startForeground(...) within 10 seconds.

3

Show the ongoing notification

Build a notification with a channel and call startForeground(NOTIF_ID, notification, FOREGROUND_SERVICE_TYPE_*). This is the user-facing surface.

Android 14 + 15 Restrictions to Know

  • Android 14: declaring foregroundServiceType is mandatory. The matching runtime permission is required at start time.
  • Android 14: you cannot start a foreground service from the background unless you fall under one of the documented exemptions (FCM high-priority message, alarm trigger, user-initiated job, etc.).
  • Android 15: dataSync and mediaProcessing services are time-bounded; long-running sync belongs in WorkManager.
  • Android 15: shortService capped at three minutes total; cannot be promoted to a different type.
  • Android 16: stricter user-engagement rules and richer ProgressStyle notifications for live progress.

Best Use Cases for Foreground Services

Turn-by-turn navigation

location FGS + MediaStyle/CustomView notification.

Music & podcasts

mediaPlayback FGS + MediaStyle notification.

Voice / video calls

phoneCall FGS + CallStyle notification.

Workouts

health FGS + ongoing notification with stats.

Large downloads / uploads

dataSync FGS (bounded) or WorkManager for unattended work.

Screen recording

mediaProjection FGS + ongoing notification.

iOS Equivalent

iOS does not let apps run general foreground services. Instead, it offers narrow background modes (audio, location, VoIP, BLE central, push to talk) plus the Live Activities framework as the user-facing “something is happening” surface. A Live Activity often does the work an Android FGS + ongoing notification do together.

Frequently Asked Questions

What is a foreground service on Android?

A foreground service is an Android service the system treats as user-visible work — it stays alive even when the app is in the background, but it must show a persistent notification so the user knows it is running. Used for music playback, navigation, calls, large downloads, and live tracking.

What is a foreground service type?

Since Android 10 you must declare what kind of work your foreground service does — location, mediaPlayback, dataSync, phoneCall, camera, microphone, mediaProjection, health, remoteMessaging, systemExempted, shortService, or specialUse. Android 14 made declaring the type mandatory and tied each type to runtime permissions.

What changed in Android 14 for foreground services?

Android 14 enforces typed FGS, requires the matching runtime permissions, and rejects background starts of foreground services unless you have an allowed exception. Use WorkManager for non-time-critical background work; use FGS only when the user is actively engaged.

What changed in Android 15?

Android 15 added stricter rules around starting FGS from the background, an updated dataSync timer (you cannot keep a dataSync FGS running forever), and shortService restrictions (capped at three minutes). It also introduced the new mediaProcessing FGS type.

What is the difference between a foreground service and an ongoing notification?

A foreground service is the runtime mechanism that keeps your code alive. An ongoing notification is the user-visible UI. They are paired — Android requires every FGS to surface an ongoing notification so the user knows the app is doing live work.

How is this different from iOS?

iOS does not let apps run general "foreground services". Instead it gives narrow background modes (audio, location, VoIP, BLE central, etc.) and persistent UI through Live Activities. Functionally a Live Activity often replaces what an Android FGS + ongoing notification do together.

Build a real Android app with foreground services.

Newly turns a one-line idea into a complete native iOS + Android app — foreground services, ongoing notifications, FCM, and Live Activities for iOS, all wired up.