The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Choose a foreground service type that matches the ongoing work users can see, declare that type and its matching manifest permission, and satisfy any separate runtime prerequisites before promoting the service. The rules depend on your app’s target SDK: apps targeting Android 14 (API 34) or later must declare a service type and its corresponding permission, while Android 12 (API 31) and later restrict many background starts.
Which foreground service permission do you need?
There is no single type-specific permission that applies to every foreground service. Declare the base android.permission.FOREGROUND_SERVICE permission and the permission matching each service type, such as android.permission.FOREGROUND_SERVICE_CAMERA for a camera service. The matching type-specific permission is a manifest permission; it does not replace any runtime permission required to use the resource. See Android’s manifest declaration guidance and service type requirements.
For apps targeting API 34 or later, declaring only the base permission is insufficient. If the service type or its required permission is missing, startup or promotion can fail. Add only types that accurately describe the service’s actual work.
Choose a type based on the work the user understands
Android’s official guidance says that beginning with Android 14 (API 34), each foreground service must declare an appropriate type. The available types differ by Android version: Android 14 lists the types below, and Android 15 adds mediaProcessing. Review the current type definitions and prerequisites before choosing.
#1 Best Overall
- YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
- LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
- MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
- NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
- BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
camera: ongoing camera use, such as capture that must continue in the foreground-service context.connectedDevice: ongoing work involving an external device or connection.dataSync: data transfer or synchronization.health: health-related work.location: location-related work, such as navigation.mediaPlayback: ongoing audio or video playback.mediaProjection: screen capture or projection.microphone: ongoing audio recording or microphone use.phoneCall: ongoing phone-call work.remoteMessaging: messaging work that meets this type’s documented criteria.shortService: a short-running service that meets the platform’s criteria.specialUse: a qualifying use case that does not fit another type and satisfies the documented requirements.systemExempted: only for qualifying system-related cases.mediaProcessing: media processing on Android 15 (API 35), subject to its platform limits.
Do not select a type merely because it seems broad or convenient. A type must fit what the service actually does, and some types have additional eligibility rules, runtime permissions, or launch restrictions. If several types genuinely apply, the manifest can combine them with |; the runtime type passed when promoting the service must also be consistent with the manifest.
Declare the service, base permission, and type permission
In the app manifest, add the base permission, the permission for the chosen type, and the type value on the service declaration. This camera example shows the relationship; use the type and matching permission for your own service instead:
Rank #2
- Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
- DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
- CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
- PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
- BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
<application ...>
<service
android:name=".CameraService"
android:foregroundServiceType="camera" />
</application>
For a service with multiple valid types, declare all applicable types and each corresponding type-specific permission. The Android manifest guidance provides the full declaration details.
Meet runtime prerequisites before promoting the service
A manifest permission does not grant access to sensitive device capabilities. Check the selected type’s prerequisites and obtain any required runtime permission or other condition before the service is promoted to foreground.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
- YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
- LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
- MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
- NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
- BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
- Camera: the app also needs the user-granted
CAMERAruntime permission. - Location: the required coarse or fine location access must be granted, and location’s background and while-in-use rules may affect whether the service can start.
- Other types: check the type-specific documentation for runtime permissions, required API calls, eligibility conditions, and restrictions.
A runtime permission grant by itself does not override restrictions on starting from the background or using a while-in-use permission. See the launch guidance alongside the type requirements.
Start and promote the service with a matching type
- Confirm the task qualifies. Identify the ongoing, user-visible work and select its appropriate type. Consider a purpose-built API instead if foreground execution is not the right fit.
- Check prerequisites before launch. Confirm that required runtime permissions and other type-specific conditions are satisfied.
- Start the service. Call
context.startForegroundService()from an allowed launch context. - Promote it promptly. In the service, call
ServiceCompat.startForeground()with a notification and the applicable foreground-service type flags. Those flags must agree with the types declared in the manifest. - Check target-SDK rules. Review background-start exceptions, type-specific time limits, and boot restrictions for the target API level.
For API and call details, follow Android’s instructions for launching a foreground service.
Rank #4
- PRIVACY DISPLAY: Automatically hide your screen from those beside you. The built-in privacy display can be preset¹ to turn on when receiving notifications, typing passwords, or using specific apps
- TYPE IT IN. TRANSFORM IT FAST: Enhance any shot in seconds on your smartphone by using Photo Assist² with Galaxy AI.³ Add objects, restore details, or apply new styles by simply typing or tapping
- NIGHTS, CAPTURED CLEARLY: From gigs to city lights, record and capture moments after dark with clarity using Nightography so your photos and videos stay crisp and clear on your Samsung Galaxy
- MAKE IT. EDIT IT. SHARE IT: Turn everyday moments into something personal with creative tools built right into your mobile phone, whether it’s a special contact photo, custom wallpaper, an invitation or more⁴
- HELP THAT KEEPS UP: Stay in the moment while Now Nudge with Galaxy AI helps you respond faster and stay organized with smart suggestions⁵ that appear exactly when you need them on your phone
Account for target SDK changes
Foreground-service behavior is tied to the SDK version your app targets, not only the Android version installed on a device. These are key milestones in the official Android guidance:
| Target API level | Important behavior |
|---|---|
| 31 or later (Android 12) | Apps generally cannot start foreground services while in the background, except under listed exemptions. |
| 34 or later (Android 14) | Apps must declare a suitable foreground-service type and its matching type-specific manifest permission. |
| 35 (Android 15) | Additional type-specific limits and restrictions apply, including limits for dataSync and mediaProcessing and changes to some BOOT_COMPLETED launches. |
Consult Android’s foreground-service changes by target SDK before updating target API behavior. For Android 15’s type-specific changes, see the Android 15 documentation.
Best Value
- Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Activating is easy, just 3 steps.
- ACTIVATION Promotion: Includes 1500 min, 1500 texts & 1500 MB Data + add more as you need it
- CAMERA SYSTEM: 50MP Quad Pixel camera. Capture sharper, more vibrant photos day or night with 4x the light sensitivity.
- PERFORMANCE: Blazing-fast Qualcomm performance. Get the speed you need for great entertainment with a Snapdragon 680 processor and 4GB of RAM.
- 64GB built-in storage. Get plenty of room for photos, movies, songs, and apps. Made for US
Android 15 media-processing limit
Under normal circumstances, a mediaProcessing foreground service is limited to six hours out of every 24 hours. The allowance is shared among the app’s services of this type. Stop the service when processing finishes or fails; see the Android 15 media-processing rules.
Know when another API is a better fit
A foreground service is not the default choice for every lengthy or deferred task. Android’s Android 14 behavior guidance recommends considering WorkManager or user-initiated data transfer jobs for use cases that do not have a suitable foreground-service type. Choose the mechanism that fits the task rather than assigning an unrelated type to make a foreground-service launch possible.
Troubleshoot foreground-service startup failures
SecurityException
Check that the app declares FOREGROUND_SERVICE, the matching FOREGROUND_SERVICE_<TYPE> permission, and the corresponding type on the service. Then confirm required runtime permissions and other prerequisites were satisfied before promotion. Finally, inspect the launch context for background-start or while-in-use restrictions. Android’s troubleshooting guide covers common failure causes.
MissingForegroundServiceTypeException
Check that the manifest service declaration contains a valid android:foregroundServiceType for the task.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsArgument-related error from startForeground()
Compare the type flags passed at runtime with the types declared in the manifest. The runtime type must be consistent with that declaration.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

