i have an app that targets Android 14 and uses the camera and location feature with the necessary manifest permissions.
When i run my app and use one of those features it doesn't produce any exceptions like this one "android.app.ForegroundServiceStartNotAllowedException" that will indicate that a foreground service is missing.
Although, does my app requires to declare the foreground service for camera and location in such case?
Not unless you plan to access location / camera / microphone in the background.
For example, if your app tracks location and you want to continue tracking even after the user has switched to another app.
Another example is if you schedule a work request using the WorkManager to run while you app is not active.
Resources:
https://developer.android.com/training/location/background https://developer.android.com/guide/background/persistent/getting-started https://developer.android.com/guide/components/foreground-services