This repository demonstrates the implementation of Broadcast Receivers in an Android app using Kotlin and Jetpack Compose. The app includes:
- Phone Boot Broadcast Receiver: Sends a notification when the phone boots.
- Internet Change Broadcast Receiver: Dynamically listens for connectivity changes.
The app requires the following permissions to function correctly:
- Starting from Android 13 (API 33), POST_NOTIFICATIONS permission is required to display notifications.
- You need to explicitly grant this permission when the app requests it during runtime.
- Without this permission, the app cannot notify you about phone boot events.
- RECEIVE_BOOT_COMPLETED permission is used to trigger the app's behavior when the phone completes booting.
- This permission is declared in the manifest and does not require user interaction.
- The app dynamically registers a receiver to monitor internet connectivity changes and doesn't require additional permissions.
-
Phone Boot Notification:
When the phone boots, the app triggers a broadcast receiver to:- Log the boot event.
- Display a notification (requires POST_NOTIFICATIONS permission).
-
Internet Change Listener:
Dynamically listens for changes in network connectivity and updates the UI accordingly.