Jump to Navigation

Me on Twitter

  • RT @rupl: 2 days 15 hours ago
  • Sorry @instapaper I can't wait any longer for you to be back online for Europeans. I'm back to @Pocket 5 weeks 5 days ago
  • Today it's #aiparis. Let's See that... 5 weeks 6 days ago
  • RT @MKBHD: Confirmed: You learn WAY more outside your comfort zone than in it. 7 weeks 49 min ago
  • RT @wselman: I try to not to post too many articles about @firefox but this is the best article I've seen that explains how we are working… 7 weeks 3 days ago
  • RT @MarciRobin: I bought a car today, and the dealership had me check off — with a pen, on paper — that I’m not a robot. https://t.co/x6nJ6… 8 weeks 2 days ago
  • If you want to quickly unregister from #Yahoo #Oath 321 (!) trackers : open browser console (F12) and run `var t=0… https://t.co/qzHuvEXZT0 8 weeks 5 days ago
  • Avis aux connaisseurs ;-) https://t.co/4uEtnV5x2E 8 weeks 5 days ago
  • RT @tewoz: Encore un carnet bien rempli... au suivant !!! #sketchbook #sketchnote #sketch #illustration #happyscribing #scribing #moleskine… 8 weeks 5 days ago
  • Net neutrality. Last chance? https://t.co/nsFcZFQGI7 9 weeks 5 days 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