Jump to Navigation

Me on Twitter

  • #android embeds http-client but not MultipartEntity ? Why not ? http://t.co/yxdmw0na 11 years 15 weeks ago
  • It's looking better and wastes less space on #Ubuntu though... #Eclipse #Juno 11 years 15 weeks ago
  • #Eclipse #Juno is ugly on XP. I now have to switch back to classic theme in addition to using traditional tabs http://t.co/yE3Y60hv #fail 11 years 15 weeks ago
  • Un très bon guide sur les tests de charge. Éléments essentiels et approche pragmatique. http://t.co/WYwgFYjW 11 years 15 weeks ago
  • RT @cedric_exbrayat: RT @hnycombinator: StackExchange average age of users for each tag http://t.co/YCgbdOOG 11 years 16 weeks ago
  • Learn what a MOOC is with the #coursera #scala experience : http://t.co/zIYG9cm5 11 years 18 weeks ago
  • RT @YourAnonNews: Justin Bieber gets 12,000 retweets for saying "thanks" so here is our attempt: thanks 11 years 20 weeks ago
  • "@Devoxx: The Devoxx 2012 tag cloud based on the titles, made by Gerard Maas. http://t.co/YRZsNxj5" #android 2nd, #scala not so far... 11 years 20 weeks ago
  • I've been leading for a few minutes on #AngryBirdsSeasons today's level at http://t.co/CAYZCCl2. Now already back to 2nd place... 11 years 21 weeks ago
  • RT @Devoxx: The #Devoxx 2012 interviews now available on Parleys @ http://t.co/jNCQXKiD The majority of the conference talks will foll ... 11 years 21 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