Notification - Notifications provide short, timely information about events in your app while it's not in use

Overview

Notification

Notifications provide short, timely information about events in your app while it's not in use.

Set Android Notification Properties

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

  • setSmallIcon(): it sets the icon of notification.
  • setContentTitle(): it is used to set the title of 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.
val notification= NotificationCompat.Builder(this, channel_id)
            .setContentTitle("Awesome Notification :)")
            .setContentText("This is the content text")
            .setSmallIcon(R.drawable.star)
            .setPriority(NotificationCompat.PRIORITY_HIGH)
            .setContentIntent(pendingIntent)
            .build()

Create A Channel

  private fun createNotificationChannel(){
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
            val channel= NotificationChannel(channel_id,channel_name,
            NotificationManager.IMPORTANCE_DEFAULT).apply {
                lightColor= Color.GREEN
                enableLights(true)
            }
            val manager = getSystemService(NOTIFICATION_SERVICE)as NotificationManager
            manager.createNotificationChannel(channel) 
       }
createNotificationChannel()
// Create an explicit intent for an Activity in your app
      val intent= Intent(this,MainActivity::class.java)
      val pendingIntent= TaskStackBuilder.create(this).run{
          addNextIntentWithParentStack(intent)
          getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT)
You might also like...
This app highlights similar design pattern seen in SnapChat Application.
This app highlights similar design pattern seen in SnapChat Application.

SnapchatClone In this repo, I tried to clone SnapChat App by implementing similar design pattern seen in major destinations of the app Screenshots I w

A private-chat-only Android App for Secure Scuttlebutt
A private-chat-only Android App for Secure Scuttlebutt

Tremola README Tremola is a Secure Scuttlebutt (SSB) client for Android that only supports private chat. Tremola aims at having the same functionality

Jetchat is a sample chat app built with Jetpack Compose.
Jetchat is a sample chat app built with Jetpack Compose.

Jetchat sample Jetchat is a sample chat app built with Jetpack Compose. To try out this sample app, you need to use Android Studio Arctic Fox You can

This app includes Implementation of Huawei and Google Kits in a single codebase using Build Variants. 🗺 📩
This app includes Implementation of Huawei and Google Kits in a single codebase using Build Variants. 🗺 📩

Build Variant App 🗾 📦 📱 Build variant is a feature of Android Studio to create a project which can be build in different versions. By using Build V

This is a Bluetooth operational Chat-App developed using Kotlin which shows the list of available devices nearby and paired devices, upon clicking you can start chat
This is a Bluetooth operational Chat-App developed using Kotlin which shows the list of available devices nearby and paired devices, upon clicking you can start chat

This is a Bluetooth operational Chat-App developed using Kotlin which shows the list of available devices nearby and paired devices, upon clicking you can start chat ... VOILA 🥳🥳 It is still in its early stages of development and currently let user to one-time chat at a time. It is under heavy development 😅

Multi Lingual Chat app - A modern chat application that allows users to translate text messages into their preferred language
Multi Lingual Chat app - A modern chat application that allows users to translate text messages into their preferred language

Multi Lingual Chat app - A modern chat application that allows users to translate text messages into their preferred language

Firebase-Chat-App-Final - An android real-time chat application implemented using firebase
Firebase-Chat-App-Final - An android real-time chat application implemented using firebase

Firebase-Chat-App-Final An android real-time chat application implemented using

Android Combined Application for chat, audio/video calls, and broadcast to millions of web and app users using VdoTok SDK.
Android Combined Application for chat, audio/video calls, and broadcast to millions of web and app users using VdoTok SDK.

Android Combined Application for chat, audio/video calls, and broadcast to millions of web and app users using VdoTok SDK.

Chat App is built to demonstrate a simple end-to-end chat encryption using RSA and AES algorithms
Chat App is built to demonstrate a simple end-to-end chat encryption using RSA and AES algorithms

End-to-End Encrypted Chat 🔒 Chat App is built to demonstrate a simple end-to-end chat encryption using RSA and AES algorithms Built With ⚒️ Jetpack C

Owner
BEYZANUR AKKUZU
BEYZANUR AKKUZU
Qiscus provide everything you need to power up your app with chats. And it's now made simple.

Introduction Qiscus Chat SDK (Software Development Kit) is a product provided by Qiscus that enables you to embed an in-app chat/chat feature in your

Qiscus - Multichannel Conversational Platform 197 Dec 27, 2022
A library to receive and show notification for Android.

Basalam Notification A library to receive and show notiffication for Android. Register or unregister user to your server. Receive Notifictation per 15

Basalam 23 Dec 14, 2022
An Android library for simple notification displayed inside ViewGroup instead of system.

SimpleNotificationBar SimpleNotificationBar is an Android library that helps developers to easily create a Notification inside a view group, instead o

Tristan Le 2 Jul 29, 2022
TwitchControlsMinecraft - A mod that lets your twitch chat let things happen in your game on a specific event

Twitch Controls Minecraft A mod that lets your Twitch chat lets your twitch chat

Marcel Böcker 2 Oct 13, 2022
Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but with this dialog you can do all thats with only one dialog.

# Media Recorder Dialog ![](https://img.shields.io/badge/Platform-Android-brightgreen.svg) ![](https://img.shields.io/badge/Android-CustomView-blue.sv

Abdullah Alhazmy 73 Nov 29, 2022
A tool for making your stay through "IC" a little better.

mr.r0bot-kt.v Mr.r0bot-kt.v is tool that handles computer logic calculations and provides a better experience through your stay at "IC". Warning Use m

null 5 Dec 7, 2021
SayHi! is an instant messaging app that allows users to send text messages to other people using the app

SayHi SayHi! is an instant messaging app that allows users to send text messages to other people using the app ?? Screen Shots ?? Features OTP Verific

Prince Fahad 0 Dec 25, 2021
Signal is a messaging app for simple private communication with friends.

Signal Android Signal is a messaging app for simple private communication with friends. Signal uses your phone's data connection (WiFi/3G/4G) to commu

Signal 23.2k Dec 28, 2022
Open Source Messenger App For Android - Real-time Messaging, Voice and Video Calls

Open Source Messenger App For Android - Real-time Messaging, Voice and Video Calls

mesibo 630 Dec 7, 2022
Sample Android App for WebRTC with Firebase as backend

Simple Demo App for Android WebRTC video call using Firebase Realtime Database as Signalling server.

Devesh Chaudhari 19 Dec 17, 2022