Notification Manager and Push Notification
Notification Manager and Push Notification
Notifications provide short, timely information about events in your app while
it isn't in use.
The Notification Manager API provides the ability to create notifications and
control their behavior.
Notifications can be displayed in the notification shade, on the lock screen, and
in the status bar.
•Notifications can be generated in Android for a variety of reasons. Here are some
common scenarios where you might generate a notification:
•New message or email: You can generate a notification when the user receives a new
message or email in your app.
•Reminder or alarm: You can generate a notification when the user has a scheduled reminder
or alarm in your app.
•Event or appointment: You can generate a notification when the user has an upcoming event
or appointment in your app.
•Progress updates: You can generate a notification to show progress updates for a long-
running operation in your app.
•App updates: You can generate a notification to inform the user about updates to your app.
•Low battery or data usage warning: You can generate a notification to warn the user about
low battery or high data usage in your app.
Developers can use the NotificationManager class to create and manage notifications within
their apps.
To create a notification, developers first need to create a NotificationCompat.Builder object,
which is a helper class that provides a convenient way to construct notifications with various
properties, such as title, text, icon, and actions.