Jump to Navigation

Me on Twitter

  • @louistouzet @CedN plus de place pour scala. Je suis inscrit pour android ! 11 years 25 weeks ago
  • @louistouzet @twandroid @louistouzet excellent ! De quoi m'inciter a réinstaller #jellybean 11 years 25 weeks ago
  • Just noticed that I've started to drink coffee lately. Wonder why... #Scala 11 years 25 weeks ago
  • #Scala sometimes u just want 2 fix ur code a bit... and u just spend the rest of the evening figuring out how to get back the working code ! 11 years 25 weeks ago
  • RT @Etalab: Encore 1 MOIS pour concourir a #Dataconnexions 2. RDV sur http://t.co/bX6ino3d pour s' inscrire et faire gagner vos applic ... 11 years 26 weeks ago
  • RT @vogella: RT @w1bble The Lance Armstrong bug - when the code never fails a test, but evidence shows it's not behaving as it should. 11 years 26 weeks ago
  • @Viadeo : Un site web à la française http://t.co/AbcWAaQi 11 years 27 weeks ago
  • @agoncal spéciale dédicace à @IBM @IBM_AppServer #websphere 11 years 28 weeks ago
  • @rovio @badpiggies is a game that calls for sharing fun moments! It deserves in-game screenshot & video capture facilities... 11 years 28 weeks ago
  • Like crashing or not crashing... 11 years 28 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