Jump to Navigation

Me on Twitter

  • @ak_anneka Je découvre ton travail : c'est génial et ça donne envie d'en avoir un chez soi ! 6 years 15 weeks 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… 6 years 15 weeks ago
  • RT @Devoxx: 6 years 17 weeks 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… 6 years 18 weeks ago
  • Wow.... Huge reservoir of liquid water detected under the surface of Mars https://t.co/PsJpjY7uFC via @AAAS @EurekAlert 6 years 21 weeks ago
  • RT @ChromiumDev: 6 years 21 weeks ago
  • RT @rupl: 6 years 22 weeks ago
  • Sorry @instapaper I can't wait any longer for you to be back online for Europeans. I'm back to @Pocket 6 years 27 weeks ago
  • Today it's #aiparis. Let's See that... 6 years 28 weeks ago
  • RT @MKBHD: Confirmed: You learn WAY more outside your comfort zone than in it. 6 years 29 weeks ago

switchdataswitch

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