Notifications
Travis Himes
Intro
- Travis Himes
- Developer for approx 12 years
- Android developer for about 4 or 5
- Work @ DramaFever, and we're hiring
- If I get something wrong, tell me!
Notifications
- Create an app
- Add a button
- Add a Click Listener to that button
- Click Listener posts a notification...
First Notification
Build the notification and post it
- Create NotificationBuilder
- Build notification
- Get Notification Manager
- Notify!
Thanks!
We're done here, have a great conference!
Just kidding
this is just the tip of the iceberg... let's go deeper
Make it more interesting
- Add a PendingIntent
- Make it go away when tapped
- Build the back stack when it's followed
- Add a DeleteIntent
- Update the notification
Keep in mind
Noitifications can be blocked by the user
Let us expand on what we've learned
- 4 types of "expandable" notifications
- Build a BigText
- Build a BigPicture
- Build an Inbox
- Build whatever you want (in a few slides)
Keep in mind
Use the right one for the situation
Take Action!
- Expandable notifications can have Actions
- Add some actions to your big notifications
- How many is too many?
Keep in mind
A LOT
Let us play with...
- Heads Up Notifications
- Lock Screen Notifications
- Notification visibility/privacy
Media Playback- Progress notification
Pimp my notification
- Custom notification
- Custom Big notification
Keep in mind
Use with care, can either put users off, or delight them...
View Heights
64 dp unexpanded
256 dp expanded
UI / Flow summary
- 3 "routes" out of a notification
- Consider navigation when building notification destinations
- Don't harass your users, there are consequences if you do...
- Give users useful options
Make it even more interesting
- Set Number
- Lights, Sound, Vibration!
- Icons (big vs small)
- A Heads-Up about Priority
- Consider the default behavior
Other things to consider
- Vibrate permission
- Ongoing notifications
- Notification's ID
- Updating notifications
- Canceling notifications
The current state of a notification
- Keep your icons in line with the style
- Consider your audience
- NotificationCompat is awesome
- Auto-downgrades the notification
- Make sure users can use the one you build
- Active Notifications (Moto X, 1st and 2nd gen)
- Wear
GCM Notifications
- You mean "push notifications"?
Before we begin
- Multiple ways to do this...
- Should use a real device
- Needs Play Services
- Old way:
- curl
- New way:
- google gcm example!
Questions?
Thanks!
We're done here, have a great conference!
Seriously this time...
Notifications
By Travis Himes
Notifications
- 1,558