Jump to Navigation

Me on Twitter

  • Agree https://t.co/aBM9iv8QvP 1 year 26 weeks ago
  • RT @fasc1nate: A termite track (top) and an ant track (bottom), each protected by its column of soldiers who face each other without attack… 1 year 36 weeks ago
  • RT @glazou: Bide total, à un point rarement atteint, de la conf NFT Londres. Dixit un participant : « la liste des spectateurs était égale… 1 year 37 weeks ago
  • RT @hugolisoir: 1 year 38 weeks ago
  • RT @petapixel: A photographer was tasked with capturing a graduation class photo, but with a twist; it had to be done underwater. https://t… 1 year 39 weeks ago
  • Behold the 1st images of DART's wild asteroid crash! | Space - https://t.co/f6CRep8JAz #NASA #dart #space I love that ! 1 year 42 weeks ago
  • La France, pays de la #liberté (de la #presse, d'expression)... A force de dériver on va finir par s'échouer 1 year 43 weeks ago
  • @agoncal @QuarkusIO @david_dewalle @loicmathieu no girl in #decathlon staff ? 1 year 43 weeks ago
  • @EnjoyDigitAll @tewoz @Siecledigital 1 year 45 weeks ago
  • I love https://t.co/zlI50waxK4 but https://t.co/M2JXDA690i is probably better for non-IT people. @zx2c4 #keepass 1 year 46 weeks 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