Notification Basics in Android (with Examples)

Android Notification Basics

In this article, we’ll learn notification basics in Android. We look at the frequently used terms and notification anatomy.

What are Notifications in Android?

A notification is a message that Android displays outside your app’s UI. Users can tap the notification to open your app or take an action directly from the notification.


notification drawer

There are terms used while implementing the notifications. Let’s look at them.

Heads-up Notification:

From Android 5.0, apps can display notifications in a floating window. They are called heads-up notifications.

heads up notification

They inform the user about the important information and only appear if the device is unlocked.

App Icon Badge:

From Android 8.0 (API level 26), launchers can indicate new notifications with a colored badge on the corresponding app icon. The badge is also known as a notification dot.

App icon badge

Users can touch & hold an app icon to see the notifications for that app. They can also act on notifications from that menu.

Notification Anatomy:

A notification contains different elements like a title, app icon, description, etc. Android system has a default template that puts all these elements together.

Notification anatomy android
  1. Small icon: It is the required element. Generally, we display the app icon (logo).
  2. App name: It is provided by the system.
  3. Timestamp: It is the time that the event related to the notification occurred. Notifications in the panel are sorted by this time. It is provided by the system, but we can also override it.
  4. Large icon: It is optional, and usually used only for contact photos. Don’t add your app icon here.
  5. Title: Title of the notification (optional).
  6. Text: Message (or description) of the notification (optional).

Notification Channels:

Channels were introduced in Android 8.0 (API level 26). They help us to group the same types of notifications. They can then be turned on or off by the user.

You can find an app’s channels in the its settings. Go to Settings > All apps > open the app you want and tap on the Notifications. For example, the YouTube app developers created notification channels like this:

youtube notification channel

In the above image, “categories” refers to the “channels.”

Starting from Android 8.0 (API level 26), all notifications must be assigned to a channel or they will not appear.

The best thing about channels is that we can customize settings for each channel (like vibration, importance, and sound), and all the notifications posted to that channel will use those settings. Users can change them at any time by navigating to the settings of your app.

Notification Importance:

We can set the importance level for the notifications. The higher the importance, the more interruptive the notification is.

We have 4 importance levels:

  1. Urgent: makes a sound and appears as a heads-up notification.
  2. High: makes a sound.
  3. Medium: makes no sound.
  4. Low: makes no sound and doesn’t appear in the status bar.

Notification Limits:

Starting with Android 8.1, apps can only make a notification sound once per second. This means that if your app posts multiple notifications in one second, only the first one will make a sound. However, all of the notifications will still appear as expected.

Android also applies a rate limit when updating notifications. If you update a single notification too many times in less than one second, the system may drop some of the updates.

These are the basic terms used while implementing the notifications in Android. I hope you have learned something new. If you have any doubts, leave a comment below.

Related Articles:


Most of the images in this post are taken from the official documentation.

Leave a Comment