Create your account

Already have an account? Login here

Note: By joining, you will receive periodic emails from Coursetro. You can unsubscribe from these emails.

Create account

103. Fire Notifications With Pug Notification

Design + Code an Android App from Scratch

Woah, wait a second..

Scrounge up some loose change to become a pro member, or login to your account to view this lesson.

Alright, join now. Or login to your account if you're already a pro member.

This video shows you how to display notifications in Android with the help of the Pug notifications library. In the first step, we add the launcher icons inside the mipmap folder according to screen density. Instead of Notification.Builder or NotificationCompat.Builder classes, we use a third party library called Pug notification. Add the dependency for pug notification inside the build.grade file. Use the PugNotification.with static method that accepts a Context, a title method to specify the title of the notification, a message method to set the content displayed inside the notification, a bigTextStyle method to display extra content on those devices capable of displaying large notifications, a smallIcon and largeIcon method to set icons for the notification and a build method that finally constructs the notification. Don’t forget to use the click method in order to start an Activity when the notification is clicked.

Course Cirriculum