SlideShare a Scribd company logo
1 of 23
Android Notifications
How not to open app and still get work done!
Notifications Manager
Android lets you put notification into the titlebar of your app.
App user can expand the notification bar and select the notification to trigger
another activity.
Classes Required for Notification
1. Notification
2. NotificationManager
Sample Code for Notification - Specify Intent
//Specify which intent would be triggered if notification is selected
Intent intent = new Intent(this, NotificationReceiver.class);
//Specify a PendingIntent to handle notification
PendingIntent pndIntent = PendingIntent.getActivity(this, (int)
System.currentTimeMillis(), intent, 0);
Actions for Notifications
Common Scenarios
1. Accept/Reject(Meeting)
2. Like/Share(Social Media Post)
3. Retweet/Like(Tweet)
4. View/Purchase(Product/Service)
5. Add/Delete(Contact Request)
Actionable Notifications - Google Drive
Create Notification (e.g. Meeting Request)
Notification ntfcn = new Notification.Builder(this)
.setContentTitle(“New Meeting Request”)
.sentContextText(“Agend”)
.setSmallIcon(R.drawable.nicon)
.setContentIntent(pndIntent)
.setAutoCancel(true)
Add Actions
.addAction(R.drawable.acpticon, “Accept”, pndIntent)
.addAction(R.drawable.rjcticon, “Reject”, pndIntent)
.addAction(R.drawable.ignrticon, “Ignore”, pndIntent).build();
Send Notification
NotificationManager ntfcnManager
= (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
notificationManager.notify(0,ntfcn);
Expandable Notifications
Android supports expandable notifications from version
4.1.
You can define a big view in addition to normal
notification view and it would be shown when notification
is expanded.
Use following three style for big view of notification
big picture style, big text style and Inbox style
Big Picture Notification
User can experience the product or service you
are offering right from the notification and not
required to open the app.
Notification ntfcn = new Notification.Builder()
//other notification class properties
.setStyle(new
Notification.BigPictureStyle().bigPicture(bgBit
map))
.build();
Roll-Up Notifications
Roll up notification displays multiple notifications into one.
This type of notification would be used mainly for social networking apps
where lots of actions are taken(interactions) and content is generated.
Notification ntfcn = new Notification.Builder()
... // The same notification properties as the others
.setStyle(new Notification.InboxStyle()
.addLine("Letsnurture likes your post")
.addLine("Letsnurture shared your post")
.setContentTitle("2 new notes")
.setSummaryText("+2 more"))
.build();
Notification and Android Wear
Android Wear is fast becoming second must have gadget for everyone.
Note: In order to provide rich notifications like other Android
Devices(Phone/Tabs) use following classes
NotificationCompat,
NotificationManagerCompat
NotificationCompat.WearableExtender
Voice Input in a Notifications
You can provide voice input in reply to any notification now.
This is specially useful in case of wearable devices where no keyboard input is
not available.
Voice Input would be managed using RemoteInput class.
If actions are fixed and predefined specify using a string array and
populate(display) using setChoices() property of RemoteInput class
Setup for Voice Input and Receive It
For setup of voice input add RemoteInput object to an action using
addRemoteInput().
From your Bundle object receive voice input using getResutlsFromIntent.
Note: Do not use Intent.getExtras() as voice input is stored as ClipData.
Add Pages to a Notifications
Space is the biggest factor on wearable devices.
Each page should have minimal details.
So, You need to divide your output in pages.
For this you need to use addPage() to add pages to main notification or use
addPages() to add multiple pages in a Collection.
Stacking Notification
Arrangement of is critical in case of wearable again because of space
constraint.
Here you can display a ‘+Number more’ e.g. +4 more so user would know how
many more notification he might have to navigate through.
Note: Use new setGroup() method to provide only one summary notification on
wearable device.
Notification Settings for Android Watch
Your Android watch is using the same settings you have notifications for each
app on your Android Phone.
1. In case where your app makes a sound or vibrate for notifications, your
watch will vibrate.
2. In case where your phone doesn’t vibrate or make a sound, your watch
would display a card but won’t vibrate.
Custom Notifications
Possibilities
1. Music Player Notification
Album Art, Track Name, Artist, Previous/Play/Next Buttons
1. Weather Notification
5-Day / Hourly forecast chart with weather condition and color coding for temp.
3. To-Do list with clear option
Custom Notification
1. Use RemoteViews to create custom
notifications
2. Use Android XML file for defining layout of
Custom Notification view
New in Android 5.0
1. New Material Design Theme
2. Lock Screen Notification
3. Priority for Notifications (High Priority would be displayed as Heads-up
Notification)
4. Cloud-Synced Notification you don’t have to dismiss same notification
from multiple devices anymore.
Examples of Heads-up notifications
1. Message from your loved one from Whatsapp
2. Alarm when device is in use
3. System Update(e.g. Battery status indicator)
4. Incoming call or SMS while device is in use
General Guidelines for Notification
1. Use distinct icon(must be as unique as your app)
2. Pulse notification LED in relation to importance of notification
3. Provide notification only for events that matters to the user
4. Show current status for ongoing notifications(e.g. music player)
5. Control visibility level with PUBLIC or PRIVATE settings
Visit www.letsnurture.com for more….

More Related Content

What's hot

What's hot (6)

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
 
Android 1.8 sensor
Android 1.8 sensorAndroid 1.8 sensor
Android 1.8 sensor
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver Component
 
Android Lesson 2
Android Lesson 2Android Lesson 2
Android Lesson 2
 
Android menus in android-chapter15
Android menus in android-chapter15Android menus in android-chapter15
Android menus in android-chapter15
 

Viewers also liked

Kespontanan Reaksi Kimia
Kespontanan Reaksi KimiaKespontanan Reaksi Kimia
Kespontanan Reaksi KimiaImam Gazali
 
Google calendar integration in iOS app
Google calendar integration in iOS appGoogle calendar integration in iOS app
Google calendar integration in iOS appKetan Raval
 
3 d touch a true game changer
3 d touch a true game changer3 d touch a true game changer
3 d touch a true game changerKetan Raval
 
Freindship
FreindshipFreindship
FreindshipNa Tak
 
Setup CSV Based Pricing in Magento
Setup CSV Based Pricing in Magento   Setup CSV Based Pricing in Magento
Setup CSV Based Pricing in Magento Ketan Raval
 
Kenaikan dan Penurunan Titik Didih
Kenaikan dan Penurunan Titik DidihKenaikan dan Penurunan Titik Didih
Kenaikan dan Penurunan Titik DidihImam Gazali
 
Facebook twitter-promo-extenstion-installation
Facebook twitter-promo-extenstion-installationFacebook twitter-promo-extenstion-installation
Facebook twitter-promo-extenstion-installationKetan Raval
 
футуризм [стельмах11а]
футуризм [стельмах11а]футуризм [стельмах11а]
футуризм [стельмах11а]kryljanauki
 
О компании
О компанииО компании
О компанииfotoman111
 
нормы построения предложений с до
нормы построения предложений с донормы построения предложений с до
нормы построения предложений с доkryljanauki
 
Marshall Cassidy-horse-around-lyrics
Marshall Cassidy-horse-around-lyricsMarshall Cassidy-horse-around-lyrics
Marshall Cassidy-horse-around-lyricsVOCAL SPIN
 
художественная речь
художественная   речьхудожественная   речь
художественная речьkryljanauki
 
Get ready for new nexus devices
Get ready for new nexus devicesGet ready for new nexus devices
Get ready for new nexus devicesKetan Raval
 

Viewers also liked (20)

Kespontanan Reaksi Kimia
Kespontanan Reaksi KimiaKespontanan Reaksi Kimia
Kespontanan Reaksi Kimia
 
Google calendar integration in iOS app
Google calendar integration in iOS appGoogle calendar integration in iOS app
Google calendar integration in iOS app
 
12 facts about backups
12 facts about backups12 facts about backups
12 facts about backups
 
3 d touch a true game changer
3 d touch a true game changer3 d touch a true game changer
3 d touch a true game changer
 
Baiguulalt
BaiguulaltBaiguulalt
Baiguulalt
 
лекція № 4
лекція № 4лекція № 4
лекція № 4
 
бурлаки
бурлакибурлаки
бурлаки
 
Freindship
FreindshipFreindship
Freindship
 
Setup CSV Based Pricing in Magento
Setup CSV Based Pricing in Magento   Setup CSV Based Pricing in Magento
Setup CSV Based Pricing in Magento
 
Kenaikan dan Penurunan Titik Didih
Kenaikan dan Penurunan Titik DidihKenaikan dan Penurunan Titik Didih
Kenaikan dan Penurunan Titik Didih
 
Facebook twitter-promo-extenstion-installation
Facebook twitter-promo-extenstion-installationFacebook twitter-promo-extenstion-installation
Facebook twitter-promo-extenstion-installation
 
футуризм [стельмах11а]
футуризм [стельмах11а]футуризм [стельмах11а]
футуризм [стельмах11а]
 
FASI sejarah
FASI sejarahFASI sejarah
FASI sejarah
 
О компании
О компанииО компании
О компании
 
нормы построения предложений с до
нормы построения предложений с донормы построения предложений с до
нормы построения предложений с до
 
Marshall Cassidy-horse-around-lyrics
Marshall Cassidy-horse-around-lyricsMarshall Cassidy-horse-around-lyrics
Marshall Cassidy-horse-around-lyrics
 
365 powerpoint ad
365 powerpoint ad365 powerpoint ad
365 powerpoint ad
 
художественная речь
художественная   речьхудожественная   речь
художественная речь
 
shareSEPHORA
shareSEPHORAshareSEPHORA
shareSEPHORA
 
Get ready for new nexus devices
Get ready for new nexus devicesGet ready for new nexus devices
Get ready for new nexus devices
 

Similar to Android notifications

Exercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callExercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callmaamir farooq
 
Developing for Android Wear - Part 1
Developing for Android Wear - Part 1Developing for Android Wear - Part 1
Developing for Android Wear - Part 1Justin Munger
 
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
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Weargabrielemariotti
 
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxxMAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx34ShreyaChauhan
 
android training_material ravy ramio
android training_material ravy ramioandroid training_material ravy ramio
android training_material ravy ramioslesulvy
 
Android terminologies
Android terminologiesAndroid terminologies
Android terminologiesjerry vasoya
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindiappsdevelopment
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorialSynapseindiappsdevelopment
 
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
 
Android Wearables ii
Android Wearables iiAndroid Wearables ii
Android Wearables iiKetan Raval
 
Android broadcast receiver tutorial
Android broadcast receiver   tutorialAndroid broadcast receiver   tutorial
Android broadcast receiver tutorialmaamir farooq
 
Android broadcast receiver tutorial
Android broadcast receiver  tutorialAndroid broadcast receiver  tutorial
Android broadcast receiver tutorialmaamir farooq
 
Android Wear, a developer's perspective
Android Wear, a developer's perspectiveAndroid Wear, a developer's perspective
Android Wear, a developer's perspectiveSebastian Vieira
 
Droidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introductionDroidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introductionMichelantonio Trizio
 
Android wear SDK introduction
Android wear SDK introductionAndroid wear SDK introduction
Android wear SDK introductionTiziano Basile
 

Similar to Android notifications (20)

Exercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callExercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone call
 
Developing for Android Wear - Part 1
Developing for Android Wear - Part 1Developing for Android Wear - Part 1
Developing for Android Wear - Part 1
 
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...
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Wear
 
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxxMAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
MAD Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
 
android training_material ravy ramio
android training_material ravy ramioandroid training_material ravy ramio
android training_material ravy ramio
 
Android terminologies
Android terminologiesAndroid terminologies
Android terminologies
 
Activity & Shared Preference
Activity & Shared PreferenceActivity & Shared Preference
Activity & Shared Preference
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
 
Android
AndroidAndroid
Android
 
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
 
Android Wearables ii
Android Wearables iiAndroid Wearables ii
Android Wearables ii
 
Android action bar and notifications-chapter16
Android action bar and notifications-chapter16Android action bar and notifications-chapter16
Android action bar and notifications-chapter16
 
Android broadcast receiver tutorial
Android broadcast receiver   tutorialAndroid broadcast receiver   tutorial
Android broadcast receiver tutorial
 
Android broadcast receiver tutorial
Android broadcast receiver  tutorialAndroid broadcast receiver  tutorial
Android broadcast receiver tutorial
 
Android Wear, a developer's perspective
Android Wear, a developer's perspectiveAndroid Wear, a developer's perspective
Android Wear, a developer's perspective
 
Broadcast Receiver
Broadcast ReceiverBroadcast Receiver
Broadcast Receiver
 
Droidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introductionDroidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introduction
 
Android wear SDK introduction
Android wear SDK introductionAndroid wear SDK introduction
Android wear SDK introduction
 

More from Ketan Raval

Amazon Alexa Auto Software Development Kit (SDK)
Amazon Alexa Auto Software Development Kit (SDK)Amazon Alexa Auto Software Development Kit (SDK)
Amazon Alexa Auto Software Development Kit (SDK)Ketan Raval
 
Proximity Marketing Solutions enhancing Businesses leveraging iBeacon SDK Int...
Proximity Marketing Solutions enhancing Businesses leveraging iBeacon SDK Int...Proximity Marketing Solutions enhancing Businesses leveraging iBeacon SDK Int...
Proximity Marketing Solutions enhancing Businesses leveraging iBeacon SDK Int...Ketan Raval
 
Zero ui future is here
Zero ui   future is hereZero ui   future is here
Zero ui future is hereKetan Raval
 
Android n and beyond
Android n and beyondAndroid n and beyond
Android n and beyondKetan Raval
 
IoT and Future of Connected world
IoT and Future of Connected worldIoT and Future of Connected world
IoT and Future of Connected worldKetan Raval
 
#Instagram API Get visibility you always wanted
#Instagram API   Get visibility you always wanted#Instagram API   Get visibility you always wanted
#Instagram API Get visibility you always wantedKetan Raval
 
Keynote - Devfest 2015 organized by GDG Ahmedabad
Keynote - Devfest 2015 organized by GDG AhmedabadKeynote - Devfest 2015 organized by GDG Ahmedabad
Keynote - Devfest 2015 organized by GDG AhmedabadKetan Raval
 
How to make your Mobile App HIPPA Compliant
How to make your Mobile App HIPPA CompliantHow to make your Mobile App HIPPA Compliant
How to make your Mobile App HIPPA CompliantKetan Raval
 
OBD Mobile App - Fault Codes, Driving Behaviour and Fuel Economy
OBD Mobile App - Fault Codes, Driving Behaviour and Fuel EconomyOBD Mobile App - Fault Codes, Driving Behaviour and Fuel Economy
OBD Mobile App - Fault Codes, Driving Behaviour and Fuel EconomyKetan Raval
 
Vehicle to vehicle communication using gps
Vehicle to vehicle communication using gpsVehicle to vehicle communication using gps
Vehicle to vehicle communication using gpsKetan Raval
 
Obd how to guide
Obd how to guideObd how to guide
Obd how to guideKetan Raval
 
Garmin api integration
Garmin api integrationGarmin api integration
Garmin api integrationKetan Raval
 
Beacon The Google Way
Beacon The Google WayBeacon The Google Way
Beacon The Google WayKetan Raval
 
Edge detection iOS application
Edge detection iOS applicationEdge detection iOS application
Edge detection iOS applicationKetan Raval
 
Big data cloudcomputing
Big data cloudcomputingBig data cloudcomputing
Big data cloudcomputingKetan Raval
 
All about Apple Watchkit
All about Apple WatchkitAll about Apple Watchkit
All about Apple WatchkitKetan Raval
 
How to upload application on iTune store
How to upload application on iTune storeHow to upload application on iTune store
How to upload application on iTune storeKetan Raval
 
Beta testing guidelines for developer
Beta testing guidelines for developerBeta testing guidelines for developer
Beta testing guidelines for developerKetan Raval
 
Swift Animated tabBar
Swift Animated tabBarSwift Animated tabBar
Swift Animated tabBarKetan Raval
 

More from Ketan Raval (20)

Amazon Alexa Auto Software Development Kit (SDK)
Amazon Alexa Auto Software Development Kit (SDK)Amazon Alexa Auto Software Development Kit (SDK)
Amazon Alexa Auto Software Development Kit (SDK)
 
Proximity Marketing Solutions enhancing Businesses leveraging iBeacon SDK Int...
Proximity Marketing Solutions enhancing Businesses leveraging iBeacon SDK Int...Proximity Marketing Solutions enhancing Businesses leveraging iBeacon SDK Int...
Proximity Marketing Solutions enhancing Businesses leveraging iBeacon SDK Int...
 
Keynote 2016
Keynote 2016Keynote 2016
Keynote 2016
 
Zero ui future is here
Zero ui   future is hereZero ui   future is here
Zero ui future is here
 
Android n and beyond
Android n and beyondAndroid n and beyond
Android n and beyond
 
IoT and Future of Connected world
IoT and Future of Connected worldIoT and Future of Connected world
IoT and Future of Connected world
 
#Instagram API Get visibility you always wanted
#Instagram API   Get visibility you always wanted#Instagram API   Get visibility you always wanted
#Instagram API Get visibility you always wanted
 
Keynote - Devfest 2015 organized by GDG Ahmedabad
Keynote - Devfest 2015 organized by GDG AhmedabadKeynote - Devfest 2015 organized by GDG Ahmedabad
Keynote - Devfest 2015 organized by GDG Ahmedabad
 
How to make your Mobile App HIPPA Compliant
How to make your Mobile App HIPPA CompliantHow to make your Mobile App HIPPA Compliant
How to make your Mobile App HIPPA Compliant
 
OBD Mobile App - Fault Codes, Driving Behaviour and Fuel Economy
OBD Mobile App - Fault Codes, Driving Behaviour and Fuel EconomyOBD Mobile App - Fault Codes, Driving Behaviour and Fuel Economy
OBD Mobile App - Fault Codes, Driving Behaviour and Fuel Economy
 
Vehicle to vehicle communication using gps
Vehicle to vehicle communication using gpsVehicle to vehicle communication using gps
Vehicle to vehicle communication using gps
 
Obd how to guide
Obd how to guideObd how to guide
Obd how to guide
 
Garmin api integration
Garmin api integrationGarmin api integration
Garmin api integration
 
Beacon The Google Way
Beacon The Google WayBeacon The Google Way
Beacon The Google Way
 
Edge detection iOS application
Edge detection iOS applicationEdge detection iOS application
Edge detection iOS application
 
Big data cloudcomputing
Big data cloudcomputingBig data cloudcomputing
Big data cloudcomputing
 
All about Apple Watchkit
All about Apple WatchkitAll about Apple Watchkit
All about Apple Watchkit
 
How to upload application on iTune store
How to upload application on iTune storeHow to upload application on iTune store
How to upload application on iTune store
 
Beta testing guidelines for developer
Beta testing guidelines for developerBeta testing guidelines for developer
Beta testing guidelines for developer
 
Swift Animated tabBar
Swift Animated tabBarSwift Animated tabBar
Swift Animated tabBar
 

Android notifications

  • 1. Android Notifications How not to open app and still get work done!
  • 2. Notifications Manager Android lets you put notification into the titlebar of your app. App user can expand the notification bar and select the notification to trigger another activity. Classes Required for Notification 1. Notification 2. NotificationManager
  • 3. Sample Code for Notification - Specify Intent //Specify which intent would be triggered if notification is selected Intent intent = new Intent(this, NotificationReceiver.class); //Specify a PendingIntent to handle notification PendingIntent pndIntent = PendingIntent.getActivity(this, (int) System.currentTimeMillis(), intent, 0);
  • 4. Actions for Notifications Common Scenarios 1. Accept/Reject(Meeting) 2. Like/Share(Social Media Post) 3. Retweet/Like(Tweet) 4. View/Purchase(Product/Service) 5. Add/Delete(Contact Request)
  • 6. Create Notification (e.g. Meeting Request) Notification ntfcn = new Notification.Builder(this) .setContentTitle(“New Meeting Request”) .sentContextText(“Agend”) .setSmallIcon(R.drawable.nicon) .setContentIntent(pndIntent) .setAutoCancel(true)
  • 7. Add Actions .addAction(R.drawable.acpticon, “Accept”, pndIntent) .addAction(R.drawable.rjcticon, “Reject”, pndIntent) .addAction(R.drawable.ignrticon, “Ignore”, pndIntent).build();
  • 8. Send Notification NotificationManager ntfcnManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); notificationManager.notify(0,ntfcn);
  • 9. Expandable Notifications Android supports expandable notifications from version 4.1. You can define a big view in addition to normal notification view and it would be shown when notification is expanded. Use following three style for big view of notification big picture style, big text style and Inbox style
  • 10. Big Picture Notification User can experience the product or service you are offering right from the notification and not required to open the app. Notification ntfcn = new Notification.Builder() //other notification class properties .setStyle(new Notification.BigPictureStyle().bigPicture(bgBit map)) .build();
  • 11. Roll-Up Notifications Roll up notification displays multiple notifications into one. This type of notification would be used mainly for social networking apps where lots of actions are taken(interactions) and content is generated. Notification ntfcn = new Notification.Builder() ... // The same notification properties as the others .setStyle(new Notification.InboxStyle() .addLine("Letsnurture likes your post") .addLine("Letsnurture shared your post") .setContentTitle("2 new notes") .setSummaryText("+2 more")) .build();
  • 12. Notification and Android Wear Android Wear is fast becoming second must have gadget for everyone. Note: In order to provide rich notifications like other Android Devices(Phone/Tabs) use following classes NotificationCompat, NotificationManagerCompat NotificationCompat.WearableExtender
  • 13. Voice Input in a Notifications You can provide voice input in reply to any notification now. This is specially useful in case of wearable devices where no keyboard input is not available. Voice Input would be managed using RemoteInput class. If actions are fixed and predefined specify using a string array and populate(display) using setChoices() property of RemoteInput class
  • 14. Setup for Voice Input and Receive It For setup of voice input add RemoteInput object to an action using addRemoteInput(). From your Bundle object receive voice input using getResutlsFromIntent. Note: Do not use Intent.getExtras() as voice input is stored as ClipData.
  • 15. Add Pages to a Notifications Space is the biggest factor on wearable devices. Each page should have minimal details. So, You need to divide your output in pages. For this you need to use addPage() to add pages to main notification or use addPages() to add multiple pages in a Collection.
  • 16. Stacking Notification Arrangement of is critical in case of wearable again because of space constraint. Here you can display a ‘+Number more’ e.g. +4 more so user would know how many more notification he might have to navigate through. Note: Use new setGroup() method to provide only one summary notification on wearable device.
  • 17. Notification Settings for Android Watch Your Android watch is using the same settings you have notifications for each app on your Android Phone. 1. In case where your app makes a sound or vibrate for notifications, your watch will vibrate. 2. In case where your phone doesn’t vibrate or make a sound, your watch would display a card but won’t vibrate.
  • 18. Custom Notifications Possibilities 1. Music Player Notification Album Art, Track Name, Artist, Previous/Play/Next Buttons 1. Weather Notification 5-Day / Hourly forecast chart with weather condition and color coding for temp. 3. To-Do list with clear option
  • 19. Custom Notification 1. Use RemoteViews to create custom notifications 2. Use Android XML file for defining layout of Custom Notification view
  • 20. New in Android 5.0 1. New Material Design Theme 2. Lock Screen Notification 3. Priority for Notifications (High Priority would be displayed as Heads-up Notification) 4. Cloud-Synced Notification you don’t have to dismiss same notification from multiple devices anymore.
  • 21. Examples of Heads-up notifications 1. Message from your loved one from Whatsapp 2. Alarm when device is in use 3. System Update(e.g. Battery status indicator) 4. Incoming call or SMS while device is in use
  • 22. General Guidelines for Notification 1. Use distinct icon(must be as unique as your app) 2. Pulse notification LED in relation to importance of notification 3. Provide notification only for events that matters to the user 4. Show current status for ongoing notifications(e.g. music player) 5. Control visibility level with PUBLIC or PRIVATE settings