Notifications Tutorial Part 1 - NOTIFICATION CHANNELS - Android Studio Tutorial

Published: 07 May 2018
on channel: Coding in Flow
258,213
3.1k

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:
https://developer.android.com/referen...
NotificationChannel:
https://developer.android.com/referen...
NotificationCompat:
https://developer.android.com/referen...
NotificationCompat.Builder:
https://developer.android.com/referen...

Watch the whole playlist:
   • Playlist  

Example code for this part:
https://gist.github.com/codinginflow/...

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

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

❗ Subscribe to the channel:
   / codinginflo.  .

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

❓ Join our free developer community:
  / discord  

📣 Follow Coding in Flow on other sites:
Facebook:   / codinginflow  
Instagram:   / codinginflow  
TikTok:   / codinginflow  
Twitter:   / codinginflow  
Github: https://github.com/codinginflow

💰 Business requests, sponsoring, etc.: info@codinginflow.com


On this page of the site you can watch the video online Notifications Tutorial Part 1 - NOTIFICATION CHANNELS - Android Studio Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Coding in Flow 07 May 2018, share the link with friends and acquaintances, this video has already been watched 258,213 times on youtube and it was liked by 3.1 thousand viewers. Enjoy your viewing!