SlideShare a Scribd company logo
1 of 15
Notifications
Android OS 4.4Android OS 5.2LockScreen
Notification
Augmentation of notification
Android OS 1.5 Android OS 1.6 Android OS 2.3 Heads-Up
Notification
Types of notification added from android version 4.1
ONE TWO THREE FOUR FIVE
Big text notification contracted & expanded.
NotificationCompat.Builder notification = new
NotificationCompat.Builder(TemplateOne.this);
notification.setStyle(new
Notification.BigTextStyle().bigText("theblogof
infinite replied...")) .build();
notification.setStyle(new Notification.InboxStyle()
.addLine("Soandso likes your post")
.addLine("Soandso reblogged your post")
.setContentTitle("3 new notes")
.setSummaryText("+3 more"))
.build();
Roll-Up NotificationsBig Picture Notifications
notification.setStyle(new
Notification.BigPictureStyle().bigPicture(mBitmap))
.build();
Action Notifications
NotificationCompat.Action visitBlog = new
NotificationCompat.Action(R.drawable.ic_person,
"Visit blog", mPendingBlogIntent);
NotificationCompat.Action follow = new
NotificationCompat.Action(R.drawable.ic_follow,
"Follow", mPendingFollowIntent);
notification.addAction(visitBlog)
.addAction(visitBlog)
.addAction(follow)
.build();
Custom Notifications
Custom Music player Notification Custom Weather Notification
Android Nougat
Notifications
Direct Reply
With direct reply feature in
Android N, users can quickly
respond to text message or
update the task directly
within the notification
interface.
Direct Reply
1. Create an instance of RemoteInput.Builder that you can add to your notification action.
2. Attach the RemoteInput object to an action using addRemoteInput().
// Key for the string that's delivered in the action's intent.
private static final String KEY_TEXT_REPLY = "key_text_reply";
String replyLabel = getResources().getString(R.string.reply_label);
RemoteInput remoteInput = new RemoteInput.Builder(KEY_TEXT_REPLY)
.setLabel(replyLabel)
.build();
// Create the reply action and add the remote input.
Notification.Action action =
new Notification.Action.Builder(R.drawable.ic_reply_icon,
getString(R.string.label), replyPendingIntent)
.addRemoteInput(remoteInput)
.build();
Direct Reply
3. Applying the action to a notification and issue the notification.
// Build the notification and add the action.
Notification newMessageNotification =
new Notification.Builder(mContext)
.setSmallIcon(R.drawable.ic_message)
.setContentTitle(getString(R.string.title))
.setContentText(getString(R.string.content))
.addAction(action))
.build();
// Issue the notification.
NotificationManager notificationManager = NotificationManager.from(mContext);
notificationManager.notify(notificationId, newMessageNotification);
Swipe behaviour
for notifications.
Swiping the notification
shows a gear icon behind
which can be used to make
changes to when a
notification for the app
should be fired.
Android Wear
Notifications
Android Wear
Some of the visual updates and comparision between wear 1.x and wear 2.0
• Android Wear 2.0 updates the visual style of
notifications as well as introduces expanded
notifications, which provide substantial additional
content and actions in an app-like experience.
• Update touch targets of a notification.
• Dark background color.
• Updated horizontal swipe gesture on a notification
Expanded Notification
1. Adding additional content.
• To show additional content in your expanded notification, see Adding Pages to a
Notification.
• Additional content pages are stacked vertically in the expanded notification and
appear in the order they were added. These additional content pages can optionally
use a style such as BigTextStyle or BigPictureStyle.
2. Primary action
• The expanded notification will contain one primary action, which is the first action
in the notification unless a different action is specified using setContentAction().
3. Additional actions
• To specify additional actions, use addAction() or addActions(). The action drawer
of the expanded notification contains all available actions.
Smart Reply
// Create the reply action and add the remote input
NotificationCompat.Action action =
new NotificationCompat.Action.Builder(R.drawable.ic_reply_icon,
getString(R.string.label), replyPendingIntent)
.addRemoteInput(remoteInput)
// Allow generated replies
.setAllowGeneratedReplies(true)
.build();
References
• https://www.objc.io/issues/11-android/android-notifications/
• http://www.androidcentral.com/whats-new-android-n
• https://developer.android.com/preview/features/notification-updates.html
• https://www.youtube.com/watch?v=-iog_fmm6mE
Queries ??
Thank You
Pankaj Lilan
Android Developer @ Gracia Marcom
pankaj.lilan@gmail.com
www.pankajlilan.com
@PankajLilan

More Related Content

What's hot

Local Notification Tutorial
Local Notification TutorialLocal Notification Tutorial
Local Notification TutorialKetan Raval
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentAhsanul Karim
 
Create an other activity lesson 3
Create an other activity lesson 3Create an other activity lesson 3
Create an other activity lesson 3Kalluri Vinay Reddy
 

What's hot (7)

Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Wear
 
Local Notification Tutorial
Local Notification TutorialLocal Notification Tutorial
Local Notification Tutorial
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver Component
 
Android menus in android-chapter15
Android menus in android-chapter15Android menus in android-chapter15
Android menus in android-chapter15
 
Android 1.8 sensor
Android 1.8 sensorAndroid 1.8 sensor
Android 1.8 sensor
 
Android Lesson 2
Android Lesson 2Android Lesson 2
Android Lesson 2
 
Create an other activity lesson 3
Create an other activity lesson 3Create an other activity lesson 3
Create an other activity lesson 3
 

Viewers also liked

Android location
Android locationAndroid location
Android locationKrazy Koder
 
Android appwidget
Android appwidgetAndroid appwidget
Android appwidgetKrazy Koder
 
Android L04 - Notifications and Threading
Android L04 - Notifications and ThreadingAndroid L04 - Notifications and Threading
Android L04 - Notifications and ThreadingMohammad Shaker
 
Android ui dialog
Android ui dialogAndroid ui dialog
Android ui dialogKrazy Koder
 
Alertdialog in android
Alertdialog in androidAlertdialog in android
Alertdialog in androidDurai S
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAhsanul Karim
 
Google Android 7.0 Nougat History Features and more
Google Android 7.0 Nougat History Features and moreGoogle Android 7.0 Nougat History Features and more
Google Android 7.0 Nougat History Features and moreDevakumar Kp
 

Viewers also liked (12)

Android location
Android locationAndroid location
Android location
 
Android appwidget
Android appwidgetAndroid appwidget
Android appwidget
 
Action Bar and Menu
Action Bar and MenuAction Bar and Menu
Action Bar and Menu
 
Android L04 - Notifications and Threading
Android L04 - Notifications and ThreadingAndroid L04 - Notifications and Threading
Android L04 - Notifications and Threading
 
2310 b xd
2310 b xd2310 b xd
2310 b xd
 
Android ui dialog
Android ui dialogAndroid ui dialog
Android ui dialog
 
Alertdialog in android
Alertdialog in androidAlertdialog in android
Alertdialog in android
 
Android ui menu
Android ui menuAndroid ui menu
Android ui menu
 
Android UI Development
Android UI DevelopmentAndroid UI Development
Android UI Development
 
Welcome to rx java2
Welcome to rx java2Welcome to rx java2
Welcome to rx java2
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form Widgets
 
Google Android 7.0 Nougat History Features and more
Google Android 7.0 Nougat History Features and moreGoogle Android 7.0 Nougat History Features and more
Google Android 7.0 Nougat History Features and more
 

Similar to Android Notifications Evolution

Android Wearables ii
Android Wearables iiAndroid Wearables ii
Android Wearables iiKetan Raval
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Weargabrielemariotti
 
Exercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callExercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callmaamir farooq
 
Session #8 adding magic to your app
Session #8  adding magic to your appSession #8  adding magic to your app
Session #8 adding magic to your appVitali Pekelis
 
Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...naseeb20
 
Keynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptxKeynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptxEqraKhattak
 
Android Wear – IO Extended
Android Wear – IO ExtendedAndroid Wear – IO Extended
Android Wear – IO ExtendedDouglas Drumond
 
Mobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdfMobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdfAbdullahMunir32
 
Building Extensible RIAs with MEF
Building Extensible RIAs with MEFBuilding Extensible RIAs with MEF
Building Extensible RIAs with MEFGlenn Block
 
MobileAppDev Handout#6
MobileAppDev Handout#6MobileAppDev Handout#6
MobileAppDev Handout#6trupti1976
 
Android Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidDenis Minja
 
Android Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptxAndroid Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptxKNANTHINIMCA
 

Similar to Android Notifications Evolution (20)

Android action bar and notifications-chapter16
Android action bar and notifications-chapter16Android action bar and notifications-chapter16
Android action bar and notifications-chapter16
 
Android Wearables ii
Android Wearables iiAndroid Wearables ii
Android Wearables ii
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Wear
 
Exercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callExercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone call
 
Intake 37 9
Intake 37 9Intake 37 9
Intake 37 9
 
Session #8 adding magic to your app
Session #8  adding magic to your appSession #8  adding magic to your app
Session #8 adding magic to your app
 
Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...
 
Intake 38 9
Intake 38 9Intake 38 9
Intake 38 9
 
Keynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptxKeynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptx
 
Android Wear Development
Android Wear DevelopmentAndroid Wear Development
Android Wear Development
 
Android Wear – IO Extended
Android Wear – IO ExtendedAndroid Wear – IO Extended
Android Wear – IO Extended
 
Push Notification
Push NotificationPush Notification
Push Notification
 
Mobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdfMobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdf
 
Building Extensible RIAs with MEF
Building Extensible RIAs with MEFBuilding Extensible RIAs with MEF
Building Extensible RIAs with MEF
 
Notifications
NotificationsNotifications
Notifications
 
MobileAppDev Handout#6
MobileAppDev Handout#6MobileAppDev Handout#6
MobileAppDev Handout#6
 
How to create android push notifications with custom view
How to create android push notifications with custom viewHow to create android push notifications with custom view
How to create android push notifications with custom view
 
Android Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_android
 
Android UI
Android UIAndroid UI
Android UI
 
Android Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptxAndroid Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptx
 

Recently uploaded

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Recently uploaded (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Android Notifications Evolution

  • 2. Android OS 4.4Android OS 5.2LockScreen Notification Augmentation of notification Android OS 1.5 Android OS 1.6 Android OS 2.3 Heads-Up Notification
  • 3. Types of notification added from android version 4.1 ONE TWO THREE FOUR FIVE Big text notification contracted & expanded. NotificationCompat.Builder notification = new NotificationCompat.Builder(TemplateOne.this); notification.setStyle(new Notification.BigTextStyle().bigText("theblogof infinite replied...")) .build(); notification.setStyle(new Notification.InboxStyle() .addLine("Soandso likes your post") .addLine("Soandso reblogged your post") .setContentTitle("3 new notes") .setSummaryText("+3 more")) .build(); Roll-Up NotificationsBig Picture Notifications notification.setStyle(new Notification.BigPictureStyle().bigPicture(mBitmap)) .build(); Action Notifications NotificationCompat.Action visitBlog = new NotificationCompat.Action(R.drawable.ic_person, "Visit blog", mPendingBlogIntent); NotificationCompat.Action follow = new NotificationCompat.Action(R.drawable.ic_follow, "Follow", mPendingFollowIntent); notification.addAction(visitBlog) .addAction(visitBlog) .addAction(follow) .build(); Custom Notifications Custom Music player Notification Custom Weather Notification
  • 5. Direct Reply With direct reply feature in Android N, users can quickly respond to text message or update the task directly within the notification interface.
  • 6. Direct Reply 1. Create an instance of RemoteInput.Builder that you can add to your notification action. 2. Attach the RemoteInput object to an action using addRemoteInput(). // Key for the string that's delivered in the action's intent. private static final String KEY_TEXT_REPLY = "key_text_reply"; String replyLabel = getResources().getString(R.string.reply_label); RemoteInput remoteInput = new RemoteInput.Builder(KEY_TEXT_REPLY) .setLabel(replyLabel) .build(); // Create the reply action and add the remote input. Notification.Action action = new Notification.Action.Builder(R.drawable.ic_reply_icon, getString(R.string.label), replyPendingIntent) .addRemoteInput(remoteInput) .build();
  • 7. Direct Reply 3. Applying the action to a notification and issue the notification. // Build the notification and add the action. Notification newMessageNotification = new Notification.Builder(mContext) .setSmallIcon(R.drawable.ic_message) .setContentTitle(getString(R.string.title)) .setContentText(getString(R.string.content)) .addAction(action)) .build(); // Issue the notification. NotificationManager notificationManager = NotificationManager.from(mContext); notificationManager.notify(notificationId, newMessageNotification);
  • 8. Swipe behaviour for notifications. Swiping the notification shows a gear icon behind which can be used to make changes to when a notification for the app should be fired.
  • 9.
  • 11. Android Wear Some of the visual updates and comparision between wear 1.x and wear 2.0 • Android Wear 2.0 updates the visual style of notifications as well as introduces expanded notifications, which provide substantial additional content and actions in an app-like experience. • Update touch targets of a notification. • Dark background color. • Updated horizontal swipe gesture on a notification
  • 12. Expanded Notification 1. Adding additional content. • To show additional content in your expanded notification, see Adding Pages to a Notification. • Additional content pages are stacked vertically in the expanded notification and appear in the order they were added. These additional content pages can optionally use a style such as BigTextStyle or BigPictureStyle. 2. Primary action • The expanded notification will contain one primary action, which is the first action in the notification unless a different action is specified using setContentAction(). 3. Additional actions • To specify additional actions, use addAction() or addActions(). The action drawer of the expanded notification contains all available actions.
  • 13. Smart Reply // Create the reply action and add the remote input NotificationCompat.Action action = new NotificationCompat.Action.Builder(R.drawable.ic_reply_icon, getString(R.string.label), replyPendingIntent) .addRemoteInput(remoteInput) // Allow generated replies .setAllowGeneratedReplies(true) .build();
  • 14. References • https://www.objc.io/issues/11-android/android-notifications/ • http://www.androidcentral.com/whats-new-android-n • https://developer.android.com/preview/features/notification-updates.html • https://www.youtube.com/watch?v=-iog_fmm6mE
  • 15. Queries ?? Thank You Pankaj Lilan Android Developer @ Gracia Marcom pankaj.lilan@gmail.com www.pankajlilan.com @PankajLilan

Editor's Notes

  1. Which was previously possible by long clicking on the notification.