This sample app demonstrates how to use the foreground service on Android 14. It is meant as a companion to the Guide to Foreground Services on Android 14 blog post.
Included are the following functionalities:
- Starting a foreground service with a declared foreground service type of location
- Requesting location permissions before service is started
- Binding to the foreground service from Activity to display the service status and receive location updates
- Stopping the service from the activity
- Requesting notification permission to show foreground service notification
Previews
References