HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

Notifications Tutorial Part 1 - NOTIFICATION CHANNELS - Android Studio Tutorial

258,552 views October 25, 2018 20:04

Watch on YouTube
ChannelCoding in Flow

Description from the creator

In this video series we will learn everything about notifications in Android.
In part 1 we will start by creating notification channels (Categories) which are necessary since Android Oreo (API level 26) to be able to show any notifications. These channels should be created as soon as we start our app, so we will do it in the onCreate method of a class that extends Application.
When we create these channels, we have to pass an ID, a name and an importance level. Additionally we can customize the channel further, like enabling the LED, activating vibration or changing the sound, but the user has ultimate control over the channel's behavior.
When our NotificationChannel objects are created, we pass them to the NotificationManager's createNotificationChannel method.
When we then want to show a notification, we create it with the NotificationCompat.Builder, where we can set a title, a message, an icon, a priority level, a category and many more customization options, and then we pass this
Notification object to the NotificationManagerCompat's notify method, where we also have to pass an ID which we can later use to update or cancel this particular notification.

Documentation:
NotificationManager:
developer.android.com/reference/android/app/Not…
NotificationChannel:
developer.android.com/reference/android/app/Not…
NotificationCompat:
developer.android.com/reference/android/support…
NotificationCompat.Builder:
developer.android.com/reference/android/support…

Watch the whole playlist:
youtube.com/playlist?list=PLrnPJCHvNZuCN52QwGu7…

Example code for this part:
gist.github.com/codinginflow/33e2ef8270892acca1…

____________________
💻 Find the BEST programming tutorials on TutHub:
tuthub.io

⭐ Get my MVVM Caching Course now:
codinginflow.com/caching

❗ Subscribe to the channel:
youtube.com/c/codinginflo...

📨 Subscribe to the Coding in Flow newsletter:
codinginflow.com/newsletter

❓ Join our free developer community:
discord.gg/TSnMvmc

📣 Follow Coding in Flow on other sites:
Facebook: facebook.com/codinginflow
Instagram: instagram.com/codinginflow
TikTok: tiktok.com/@codinginflow
Twitter: twitter.com/codinginflow
Github: github.com/codinginflow

💰 Business requests, sponsoring, etc.: [email protected]

About this tutorial

Coding in Flow published this 20:04 video tutorial on October 25, 2018. It has been watched 258,552 times on YouTube.

Duration
20:04
Published
October 25, 2018
Views
258,552
Likes
3,157

Tags

Share

Further reading

  • Android O: How to Use Notification Channels code.tutsplus.com

    In this tutorial, you learned about Notification Channels for Android O: what they are and how to create one, as well as how to post a notification to a channel, how to access a channel's notification settings, how to g…

  • Part 1 - Notification Channels - Tutorials - Coding in Flow codinginflow.com

    In part 1 we will start by creating notification channels (Categories) which are necessary since Android Oreo (API level 26) to be able to show any notifications. These channels should be created as soon as we start our…

  • Android Notifications Tutorial: Getting Started ... raywenderlich.com

    In this tutorial, you have learned how to create notifications, notification channels, notification groups, and customize their display and behavior. You have learned how to add actions to notifications and work with th…

This tutorial in other languages