Practical 8 : Android send notifications - IndianTechnoEra
Latest update Android YouTube

Practical 8 : Android send notifications

Aim: 

Aim: Write a program to send notifications.

Android Notification provides short, timely information about the action that happened in the application, even if it is not running. 

The notification displays the icon, title, and some amount of content text.

Set Android Notification Properties: The properties of Android notifications are set using NotificationCompat.Builder object. Some of the notification properties are mentioned below:

setSmallIcon(): It sets the icon of the notification.
setContentTitle(): It is used to set the title of a notification.
setContentText(): It is used to set the text message.
setAutoCancel(): It sets the cancelable property of notification.
setPriority(): It sets the priority of notification.

Process:

Step 1: Create a project

Step 2: Design the UI part in the activity_main.xml file that send a notification

Step 3: Access permission through the androidManifest.xml file

Step 4: Create new activity to show the notification 

Code:

Output:

Practical 8 : Android send notifications


Post a Comment

Feel free to ask your query...
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.