Jump to Navigation

Me on Twitter

  • Soooo true.... https://t.co/vhEsNGV0uQ 6 days 11 hours ago
  • @ak_anneka Je découvre ton travail : c'est génial et ça donne envie d'en avoir un chez soi ! 1 week 3 days ago
  • RT @ak_anneka: Je l'ai terminé ! I did it, I did it, yeah! #art #ink #artist #bird #tiny #objects #doodle #fun #color #red #yellow #ooak ht… 1 week 3 days ago
  • RT @Devoxx: 3 weeks 4 days ago
  • RT @esa: Our week in #space images, featuring an Earth view taken by @Astro_Alex on the Space Station, the #Aeolus satellite's Vega rocket… 4 weeks 2 days ago
  • Wow.... Huge reservoir of liquid water detected under the surface of Mars https://t.co/PsJpjY7uFC via @AAAS @EurekAlert 7 weeks 6 days ago
  • RT @ChromiumDev: 7 weeks 6 days ago
  • RT @rupl: 8 weeks 5 days ago
  • Sorry @instapaper I can't wait any longer for you to be back online for Europeans. I'm back to @Pocket 14 weeks 1 day ago
  • Today it's #aiparis. Let's See that... 14 weeks 1 day ago

Notification API

android Tweaking Android Notifications

For SwitchDataSwitch, I wanted to provide users with a 1-click solution to enable and disable data traffic (2G/3G/...).
I chose the notification bar since it is a very accessible place, visible almost all the time and that can be expanded without stopping the running activity :

Expanding the notification bar 
The notification bar is usually presented in its reduced form (here the dark bar at the top of the screen with the smallest icons) but can be expanded by sliding it downwards.

Unfortunately, Android's Notification API is really made for instant notifications, not persistent ones, and that implies several inconveniences :

  • when creating a notification, the developer has to put an icon in the reduced notification bar, taking some precious space
  • by default an 'event timestamp' is shown next to the expanded content of the notification, which means nothing for a permanent service
  • there is no programmatic way to know if a notification is currently displayed or not

This article describes a way to create a notification that :

  • doesn't show up in the reduced notification bar
  • doesn't have a timestamp in the expanded notification bar
...
Syndicate content