Android Programming Tutorials

(Romina) #1
A Subtle Notification

Extra Credit...............................................................................................


Here are some things you can try beyond those step-by-step instructions:



  • If you exit and re-open Patchy, you will notice that the timeline
    appears to vanish. That would occur if PostMonitor had not yet been


destroyed, and the new Patchy instance reconnects to it. Modify
PostMonitor to always send over the first timeline on the initial

poll().



  • Support a user-configurable keyword (or set of keywords) via a
    Preference.

  • Use the count field on a Notification to indicate how many matches
    on the keyword were found in between taps on the event


information in the notification drawer.


Further Reading........................................................................................


Notifications are covered in the "Alerting Users Via Notifications" chapter


of The Busy Coder's Guide to Android Development.


225
Free download pdf