SlideShare una empresa de Scribd logo
1 de 25
Android Notifications. Testing
guideline
By Lera Stadnyk
Notification
is a message you can display to any user outside of your app. You’ve probably seen and heard
them after a day with device turned off =)
Implementation
Notification.Builder class that issues notifications was added to Android OS in 3.0 (API lvl 11).
Design
Design described in Material Design Guide since v.5.0 (API 21).
By the way, till 5.0 Lollipop icons on notifications were colored. They are black’n’white now by
default. To make them colored we change targetSdkVersion in gradle to 19.
Receiving notifications+test - potential issues
●Notification was received after each action, not after 1st as it was intended.
●Notification can be received by forbidden users - blocked, guests, wrong users.
●Notification comes only to devices where app is open (active).
●Staging N can be received on production server.
●Notifications received after leaving an app+logging out.
●Duplicated N were sent to user.
●N may be received out of time (too early, too late). Critical in games!
●Missing N on the lock screen on Android 5.0 Lollipop.
●Huawei and Xiaomi devices have evil task killer services that interfere with notification service. In order for
notifications to work, users need to add the app to allowed apps in those devices' security settings. Huawei:
Phone Manager App > Protected apps > Add app to the list. Xiaomi: Services > Security > Permissions >
Autostart (or Settings -> Permissions > Autostart on new devices ), find app and enable autostart. Let the
users know that.
●User can not receives pushes with full memory/cache.
●On some devices (e.g. Moto g 2) using them with guest user may interfere N receiving.
●Ns may not work at all on OS lower than v.4.4.4. on Nexus 5.
●Receiving a Notification may crash your app.
Content of Notification
Notification Object that we pass via code to Android
OS must contain:
- small icon.
- title.
- details text.
Otherwise, notifications won't work correctly:
white square will be shown instead on icon, system text or empty space will appear,
Notification may crash the app etc.
Possible issues:
● few different N received in a row may have the same content.
● if 2 N were received one by one 2nd may override the 1st ones content.
● icon may be grey, not colored.
● wrong content may be received.
Notification actions
Actions are optional, but Android forces developers to add at least 1 action - that one that
allows user to go directly from notification to some Activity in the app.
As notification can provide multiple actions, tap on Notification should always be defined.
Other actions are optional and may be associated with some gesture via special method from
NotificationCompat.Builder class.
Actions: tap, dismissing a N., long tap etc.
Notification actions: test
● Tap.
● Tap after logout.
● Tap being logged in via another user.
● Tap without any Internet connection.
● Maximize/minimize the app with notification being in N. panel.
● Block the screen of the app with notification being in N. panel.
● Tap on any link inside/outside the app.
● Send a N. to few devices at the same time (< 3 if you use Firebase).
Notification actions: Potential bugs
● Wrong requests go to server after tap on N.
● Tap on the N redirects user to the wrong place/ does not redirect him at all.
● N received after not intended action.
● User can access forbidden screen by tap on N.
● App crashes if we tapped on N after logout+killing the app.
● Wrong data comes from the server after tap on N + login in the app: empty screen or screen filled
with other users data (cookies to blame).
● Some functionality may be blocked after opening the app from Notification.
● App opens up by itself after minimizing if there is notification in N panel.
● App crashes after deleting the N.
Buttons
Buttons are actually a good way to provide user a way
to choose between few actions without opening an app.
Buttons were added in Android 4.1.
Buttons testing
● Tap on each one individually.
● Tap on both of them at the same time.
● Check if action provided by button was really done.
● Check the data sent via using a button.
● Tap with WiFi turned off.
● For actions that can’t be repeated, check if button become
locked.
Expanded layout
Expanded layout became available on Android 4.2 and higher.
The way it is created:
● Сreate normal notification object.
● Сall .setStyle() method with expanded argument.
Expanded layout testing
Our notification:
● Can be expanded/closed for a few times.
● Can be opened from normal/expanded view.
● Disappears after tap.
● Looks normal after closing/opening expansion panel again.
● Acts OK on Android 4.1 and lower.
Notifications Priority
is a hint to UI of device about when and how display the Notification.
The higher the priority set, the more interruptive will be the
Notification.
There are:
● Max (for critical and urgent events).
● High (important like chat messages).
● Default (for n. That don’t fall into other categories).
● Low (relevant but not urgent events).
● Min (nice-to-know background info).
Priority sets by developer. Please pay attention that only HIGH/MAX
priority notifications will be received in the Doze (energy saving) mode on
6.0 (shey should wake up device) and NO notification at all will be
received in that mode on 7.0. This behavior can be perfectly seen with
Notifications sent via Google Cloud Messaging.
Notification stacking
is a feature made to avoid creating many notifications of
the same type.
Instead, if stacking used:
● The same notification updates.
● Counter appears.
● Summary of each event appears on the notification.
Notification stacking: test
To test stacking, check:
● Notifications stacked at number of 2 and higher.
● Amount of events = amount of stacked notifications.
● Notification counter number = amount of stacked notifications.
● Counter does not change after opening/closing expansion panel.
● Create 5, 10, 100 events to check the UI.
● Expand/close the panel.
● Check stack reaction to different actions.
● Lock/unlock the screen with notification panel open.
Notification visibility / removing + test
Notification will remain visible until:
● User dismisses it manually or with “Clear all” button.
● User taps on notification (programmer called setAutoCancel() method when created Notification).
● Cancel() method called for specific notification ID which can delete ongoing notification (with
progress).
● CancelAll() method called that removes all the notifications.
To test it you:
● Dismiss Ns 1 by 1 or with “Clear all”.
● Tap on N and look if it is dismissed.
● Delete N with progress bar.
Replying to Notification
Starting in Android 7.0 (API 24) user can respond to message from notification.
After entering the text keyboard sends it to messaging app.
Developer can also add messaging/chat history to this notification.
Android OS forces developers to update or cancel Notification after app received remote
input from N.
But Android users guideline suggests that if user replies to remote update using Direct Reply (in
app), that Notification should be updated with the reply, not cancelled.
Replying to Notification: test
● Check if Notification updated.
● Check if your data transferred to the server.
● Notification reply has the same validation as reply in the app.
● Notification reply should accept special symbols, emoji.
● Reply was send correct times and to correct user.
● Empty replay wasn’t send to user if we tapped Reply and closed/deleted the N.
● Try to reply with no Internet connection.
● Lock/unlock the screen while typing.
● Maximize/minimize the app while typing.
Notification Bundling
In Android 7.0 (API 24) new representation of N queue appeared. Now
notifications sent from from 1 source will be bundled as a group.
To make this real developer should use Builder. setGroup() method.
Bundling (shows full notification) is similar to stacking (shows event summary only).
Notification Bundling
Group imposes a hierarchy on the N:
● Parent notification on the top.
● Expand the bundle to see all the children notification content.
● Expand child to see only its content.
If group was not specified by developer and app sends few notifications, Android
OS will put them together into 1 bundle.
Notification Bundling: test
● Send few similar notifications of 1 type.
● Send few notifications of different types.
● Check the maximum size of notification showing and try to exceed the limit.
● Check if bundled notification was correctly updated if it has the opportunity to
reply.
● Bundled notifications should have the same functionality as single ones.
● Send 5, 10, 50, 100 notifications of the same type to check if any limits or
graphical issues appearing.
Progress in Notifications (ongoing notification)
Notification can include an animated progress indicator.
● If you can estimate how long the operation takes and how much of it is completed in any
time, use progress bar (determinate form). Percentage can be added here.
● If you can’t estimate how long operation takes, use an activity indicator (indeterminate
form).
1. Progress bar.
2. Activity indicator.
3. Activity indicator.
Progress in Notifications (ongoing notification)
When the operation is done, progress bar can be:
● Left with according text.
● Removed.
Activity indicator always needs to be removed.
Test it:
● Thread.sleep is between the progress bar updating, so try to interrupt progress to find the crash.
● See if indicators are gone after process they displaying is done.
● Tap on the ongoing N.
● Try to dismiss it/look if process wasn’t stopped, only N disappeared.
● Try interruptions while progress bar is moving.
Preserving navigation
If Activity was started from the Notification, users expected navigation behavior must
be preserved. It means that if user taps Back button he goes back through apps
normal work flow to the Home screen.
Test it going back after each action:
● Tap on the notification from the different place and tap Back.
● Block the screen and put the app into background after tap on N, then tap back.
● Turn on Dev options - No background processes + Don’t keep activities, tap
Back(catch nullpointerexception).
● Tangle your tracks - try to go different ways and use tangled flows.
But notice - preserved navigations should be created for regular activity. If user can
Heads-up notifications
After Android 5.0 (API lvl 21) N can appears as a small floating window when the
device is active. Their difference from a compact form is ability to contain buttons.
Lock screen Notifications
After Android 5.0 (API lvl 21) Notification may appear on the lock screen (it’s
on but locked).
To display it choose a corresponding option in Settings.
Test it:
● Tap on the Notification.
● On some devices notifications are not shown on block screen at all.
● On other devices notification may be seen on the block screen even if
the corresponding option in Setting is off.
● There is pretty rare special Android issue when Notification seeing on
the block screen disappears from device at all after unlocking the
screen - it counts as seen and deleted.
How I tested Rewards Notifications
Below you can see my standard test cases set
for rewards notification functionality.
I created cases based on their functionality as
we can receive them (1st section), we can work
with them (2nd one) and we can do other
different actions (3rd one).
I’m pretty sure that this amount of cases will
cover enough to find almost all the possible
issues. Also our actions are somehow combined
during testing process and there are many
workarounds can be found.
I also used 2 platforms and 4 devices to test Ns
for friends functionality as we created Ns via
Firebase: it send Ns to 3 devices max at the
same time.
Firebase as our Notification provider
We choose Firebase to make our notifications.
Ex Google cloud messaging = Firebase now. It is official Google service.
Firebase has cool SDK and easy to set up and run.
For more information about Firebase please visit https://firebase.google.com/

Más contenido relacionado

Destacado

Destacado (10)

The Big Easy: Native Mobile App Development with Appcelerator Titanium and Ja...
The Big Easy: Native Mobile App Development with Appcelerator Titanium and Ja...The Big Easy: Native Mobile App Development with Appcelerator Titanium and Ja...
The Big Easy: Native Mobile App Development with Appcelerator Titanium and Ja...
 
Coaching
CoachingCoaching
Coaching
 
Android technology sunny
Android technology sunnyAndroid technology sunny
Android technology sunny
 
Beginner android
Beginner androidBeginner android
Beginner android
 
Architectural Design Pattern: Android
Architectural Design Pattern: AndroidArchitectural Design Pattern: Android
Architectural Design Pattern: Android
 
Kotlin 初體驗
Kotlin 初體驗Kotlin 初體驗
Kotlin 初體驗
 
Android Things - Solid Foundations
Android Things - Solid FoundationsAndroid Things - Solid Foundations
Android Things - Solid Foundations
 
Modern Android app library stack
Modern Android app library stackModern Android app library stack
Modern Android app library stack
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Similar a Android notifications. testing guideline

Mobile applicationtesting
Mobile applicationtesting Mobile applicationtesting
Mobile applicationtesting
L ESHWAR
 
Event oriented programming
Event oriented programmingEvent oriented programming
Event oriented programming
Ashwini Awatare
 
Developing for Android Wear - Part 1
Developing for Android Wear - Part 1Developing for Android Wear - Part 1
Developing for Android Wear - Part 1
Justin Munger
 
MobileApplicationTesting.pptx
MobileApplicationTesting.pptxMobileApplicationTesting.pptx
MobileApplicationTesting.pptx
Bhavani Testone
 
Mobile application testing report
Mobile application testing reportMobile application testing report
Mobile application testing report
QA Madness
 

Similar a Android notifications. testing guideline (20)

Manual for IWB.pptx
Manual for IWB.pptxManual for IWB.pptx
Manual for IWB.pptx
 
Tutorials3
Tutorials3Tutorials3
Tutorials3
 
What’s new in android o
What’s new in android oWhat’s new in android o
What’s new in android o
 
Homework seriesandroidworkshop JUly 12th
Homework seriesandroidworkshop JUly 12thHomework seriesandroidworkshop JUly 12th
Homework seriesandroidworkshop JUly 12th
 
New in orangescrum bug and issue tracking feature released
New in orangescrum   bug and issue tracking feature releasedNew in orangescrum   bug and issue tracking feature released
New in orangescrum bug and issue tracking feature released
 
MobileAppDev Handout#6
MobileAppDev Handout#6MobileAppDev Handout#6
MobileAppDev Handout#6
 
Mobile applicationtesting
Mobile applicationtesting Mobile applicationtesting
Mobile applicationtesting
 
Bcsf13a019_mcqs_ead
Bcsf13a019_mcqs_eadBcsf13a019_mcqs_ead
Bcsf13a019_mcqs_ead
 
3 - Thermometer.pptx thermometer thermometer thermometer
3 - Thermometer.pptx thermometer thermometer thermometer3 - Thermometer.pptx thermometer thermometer thermometer
3 - Thermometer.pptx thermometer thermometer thermometer
 
Event oriented programming
Event oriented programmingEvent oriented programming
Event oriented programming
 
Event driven theory
Event driven theoryEvent driven theory
Event driven theory
 
MobileApplicationTesting.pptx
MobileApplicationTesting.pptxMobileApplicationTesting.pptx
MobileApplicationTesting.pptx
 
HUAWEI MediaPad M3 8.0 Manual/User Guide
HUAWEI MediaPad M3 8.0 Manual/User GuideHUAWEI MediaPad M3 8.0 Manual/User Guide
HUAWEI MediaPad M3 8.0 Manual/User Guide
 
W2_Lec03_Lec_04_Activity.pptx
W2_Lec03_Lec_04_Activity.pptxW2_Lec03_Lec_04_Activity.pptx
W2_Lec03_Lec_04_Activity.pptx
 
Developing for Android Wear - Part 1
Developing for Android Wear - Part 1Developing for Android Wear - Part 1
Developing for Android Wear - Part 1
 
MAD mobile application development you can learn from here , we perform all c...
MAD mobile application development you can learn from here , we perform all c...MAD mobile application development you can learn from here , we perform all c...
MAD mobile application development you can learn from here , we perform all c...
 
MobileApplicationTesting.pptx
MobileApplicationTesting.pptxMobileApplicationTesting.pptx
MobileApplicationTesting.pptx
 
Android N multi window
Android N multi windowAndroid N multi window
Android N multi window
 
Mobile application testing report
Mobile application testing reportMobile application testing report
Mobile application testing report
 
Zelio soft
Zelio softZelio soft
Zelio soft
 

Más de TechMagic

Más de TechMagic (9)

K is for Kotlin
K is for KotlinK is for Kotlin
K is for Kotlin
 
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
 
Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?
 
Getting started with Stripe
Getting started with StripeGetting started with Stripe
Getting started with Stripe
 
Android developer options &amp; android sdk tools (for qa)
Android developer options &amp; android sdk tools (for qa)Android developer options &amp; android sdk tools (for qa)
Android developer options &amp; android sdk tools (for qa)
 
Tips and Tricks for email communication with customer
Tips and Tricks for email communication with customerTips and Tricks for email communication with customer
Tips and Tricks for email communication with customer
 
Test Driven Development in Node.js apps
Test Driven Development in Node.js appsTest Driven Development in Node.js apps
Test Driven Development in Node.js apps
 
OS X Server as CI for iOS
OS X Server as CI for iOSOS X Server as CI for iOS
OS X Server as CI for iOS
 
TechMagic - Development Studio for Startups (iOS, Android, Node.js)
TechMagic - Development Studio for Startups (iOS, Android, Node.js)TechMagic - Development Studio for Startups (iOS, Android, Node.js)
TechMagic - Development Studio for Startups (iOS, Android, Node.js)
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Android notifications. testing guideline

  • 2. Notification is a message you can display to any user outside of your app. You’ve probably seen and heard them after a day with device turned off =) Implementation Notification.Builder class that issues notifications was added to Android OS in 3.0 (API lvl 11). Design Design described in Material Design Guide since v.5.0 (API 21). By the way, till 5.0 Lollipop icons on notifications were colored. They are black’n’white now by default. To make them colored we change targetSdkVersion in gradle to 19.
  • 3. Receiving notifications+test - potential issues ●Notification was received after each action, not after 1st as it was intended. ●Notification can be received by forbidden users - blocked, guests, wrong users. ●Notification comes only to devices where app is open (active). ●Staging N can be received on production server. ●Notifications received after leaving an app+logging out. ●Duplicated N were sent to user. ●N may be received out of time (too early, too late). Critical in games! ●Missing N on the lock screen on Android 5.0 Lollipop. ●Huawei and Xiaomi devices have evil task killer services that interfere with notification service. In order for notifications to work, users need to add the app to allowed apps in those devices' security settings. Huawei: Phone Manager App > Protected apps > Add app to the list. Xiaomi: Services > Security > Permissions > Autostart (or Settings -> Permissions > Autostart on new devices ), find app and enable autostart. Let the users know that. ●User can not receives pushes with full memory/cache. ●On some devices (e.g. Moto g 2) using them with guest user may interfere N receiving. ●Ns may not work at all on OS lower than v.4.4.4. on Nexus 5. ●Receiving a Notification may crash your app.
  • 4. Content of Notification Notification Object that we pass via code to Android OS must contain: - small icon. - title. - details text. Otherwise, notifications won't work correctly: white square will be shown instead on icon, system text or empty space will appear, Notification may crash the app etc. Possible issues: ● few different N received in a row may have the same content. ● if 2 N were received one by one 2nd may override the 1st ones content. ● icon may be grey, not colored. ● wrong content may be received.
  • 5. Notification actions Actions are optional, but Android forces developers to add at least 1 action - that one that allows user to go directly from notification to some Activity in the app. As notification can provide multiple actions, tap on Notification should always be defined. Other actions are optional and may be associated with some gesture via special method from NotificationCompat.Builder class. Actions: tap, dismissing a N., long tap etc.
  • 6. Notification actions: test ● Tap. ● Tap after logout. ● Tap being logged in via another user. ● Tap without any Internet connection. ● Maximize/minimize the app with notification being in N. panel. ● Block the screen of the app with notification being in N. panel. ● Tap on any link inside/outside the app. ● Send a N. to few devices at the same time (< 3 if you use Firebase).
  • 7. Notification actions: Potential bugs ● Wrong requests go to server after tap on N. ● Tap on the N redirects user to the wrong place/ does not redirect him at all. ● N received after not intended action. ● User can access forbidden screen by tap on N. ● App crashes if we tapped on N after logout+killing the app. ● Wrong data comes from the server after tap on N + login in the app: empty screen or screen filled with other users data (cookies to blame). ● Some functionality may be blocked after opening the app from Notification. ● App opens up by itself after minimizing if there is notification in N panel. ● App crashes after deleting the N.
  • 8. Buttons Buttons are actually a good way to provide user a way to choose between few actions without opening an app. Buttons were added in Android 4.1. Buttons testing ● Tap on each one individually. ● Tap on both of them at the same time. ● Check if action provided by button was really done. ● Check the data sent via using a button. ● Tap with WiFi turned off. ● For actions that can’t be repeated, check if button become locked.
  • 9. Expanded layout Expanded layout became available on Android 4.2 and higher. The way it is created: ● Сreate normal notification object. ● Сall .setStyle() method with expanded argument. Expanded layout testing Our notification: ● Can be expanded/closed for a few times. ● Can be opened from normal/expanded view. ● Disappears after tap. ● Looks normal after closing/opening expansion panel again. ● Acts OK on Android 4.1 and lower.
  • 10. Notifications Priority is a hint to UI of device about when and how display the Notification. The higher the priority set, the more interruptive will be the Notification. There are: ● Max (for critical and urgent events). ● High (important like chat messages). ● Default (for n. That don’t fall into other categories). ● Low (relevant but not urgent events). ● Min (nice-to-know background info). Priority sets by developer. Please pay attention that only HIGH/MAX priority notifications will be received in the Doze (energy saving) mode on 6.0 (shey should wake up device) and NO notification at all will be received in that mode on 7.0. This behavior can be perfectly seen with Notifications sent via Google Cloud Messaging.
  • 11. Notification stacking is a feature made to avoid creating many notifications of the same type. Instead, if stacking used: ● The same notification updates. ● Counter appears. ● Summary of each event appears on the notification.
  • 12. Notification stacking: test To test stacking, check: ● Notifications stacked at number of 2 and higher. ● Amount of events = amount of stacked notifications. ● Notification counter number = amount of stacked notifications. ● Counter does not change after opening/closing expansion panel. ● Create 5, 10, 100 events to check the UI. ● Expand/close the panel. ● Check stack reaction to different actions. ● Lock/unlock the screen with notification panel open.
  • 13. Notification visibility / removing + test Notification will remain visible until: ● User dismisses it manually or with “Clear all” button. ● User taps on notification (programmer called setAutoCancel() method when created Notification). ● Cancel() method called for specific notification ID which can delete ongoing notification (with progress). ● CancelAll() method called that removes all the notifications. To test it you: ● Dismiss Ns 1 by 1 or with “Clear all”. ● Tap on N and look if it is dismissed. ● Delete N with progress bar.
  • 14. Replying to Notification Starting in Android 7.0 (API 24) user can respond to message from notification. After entering the text keyboard sends it to messaging app. Developer can also add messaging/chat history to this notification. Android OS forces developers to update or cancel Notification after app received remote input from N. But Android users guideline suggests that if user replies to remote update using Direct Reply (in app), that Notification should be updated with the reply, not cancelled.
  • 15. Replying to Notification: test ● Check if Notification updated. ● Check if your data transferred to the server. ● Notification reply has the same validation as reply in the app. ● Notification reply should accept special symbols, emoji. ● Reply was send correct times and to correct user. ● Empty replay wasn’t send to user if we tapped Reply and closed/deleted the N. ● Try to reply with no Internet connection. ● Lock/unlock the screen while typing. ● Maximize/minimize the app while typing.
  • 16. Notification Bundling In Android 7.0 (API 24) new representation of N queue appeared. Now notifications sent from from 1 source will be bundled as a group. To make this real developer should use Builder. setGroup() method. Bundling (shows full notification) is similar to stacking (shows event summary only).
  • 17. Notification Bundling Group imposes a hierarchy on the N: ● Parent notification on the top. ● Expand the bundle to see all the children notification content. ● Expand child to see only its content. If group was not specified by developer and app sends few notifications, Android OS will put them together into 1 bundle.
  • 18. Notification Bundling: test ● Send few similar notifications of 1 type. ● Send few notifications of different types. ● Check the maximum size of notification showing and try to exceed the limit. ● Check if bundled notification was correctly updated if it has the opportunity to reply. ● Bundled notifications should have the same functionality as single ones. ● Send 5, 10, 50, 100 notifications of the same type to check if any limits or graphical issues appearing.
  • 19. Progress in Notifications (ongoing notification) Notification can include an animated progress indicator. ● If you can estimate how long the operation takes and how much of it is completed in any time, use progress bar (determinate form). Percentage can be added here. ● If you can’t estimate how long operation takes, use an activity indicator (indeterminate form). 1. Progress bar. 2. Activity indicator. 3. Activity indicator.
  • 20. Progress in Notifications (ongoing notification) When the operation is done, progress bar can be: ● Left with according text. ● Removed. Activity indicator always needs to be removed. Test it: ● Thread.sleep is between the progress bar updating, so try to interrupt progress to find the crash. ● See if indicators are gone after process they displaying is done. ● Tap on the ongoing N. ● Try to dismiss it/look if process wasn’t stopped, only N disappeared. ● Try interruptions while progress bar is moving.
  • 21. Preserving navigation If Activity was started from the Notification, users expected navigation behavior must be preserved. It means that if user taps Back button he goes back through apps normal work flow to the Home screen. Test it going back after each action: ● Tap on the notification from the different place and tap Back. ● Block the screen and put the app into background after tap on N, then tap back. ● Turn on Dev options - No background processes + Don’t keep activities, tap Back(catch nullpointerexception). ● Tangle your tracks - try to go different ways and use tangled flows. But notice - preserved navigations should be created for regular activity. If user can
  • 22. Heads-up notifications After Android 5.0 (API lvl 21) N can appears as a small floating window when the device is active. Their difference from a compact form is ability to contain buttons.
  • 23. Lock screen Notifications After Android 5.0 (API lvl 21) Notification may appear on the lock screen (it’s on but locked). To display it choose a corresponding option in Settings. Test it: ● Tap on the Notification. ● On some devices notifications are not shown on block screen at all. ● On other devices notification may be seen on the block screen even if the corresponding option in Setting is off. ● There is pretty rare special Android issue when Notification seeing on the block screen disappears from device at all after unlocking the screen - it counts as seen and deleted.
  • 24. How I tested Rewards Notifications Below you can see my standard test cases set for rewards notification functionality. I created cases based on their functionality as we can receive them (1st section), we can work with them (2nd one) and we can do other different actions (3rd one). I’m pretty sure that this amount of cases will cover enough to find almost all the possible issues. Also our actions are somehow combined during testing process and there are many workarounds can be found. I also used 2 platforms and 4 devices to test Ns for friends functionality as we created Ns via Firebase: it send Ns to 3 devices max at the same time.
  • 25. Firebase as our Notification provider We choose Firebase to make our notifications. Ex Google cloud messaging = Firebase now. It is official Google service. Firebase has cool SDK and easy to set up and run. For more information about Firebase please visit https://firebase.google.com/