Jump to Navigation

Me on Twitter

  • @codinghorror Many thanks @codinghorror it's 17mn that could have been told in 5mn but it's a good demonstration of… https://t.co/d5D5NtGdi2 4 years 14 weeks ago
  • RT @matvelloso: And you think you're a big deal because you can ssh into your container... https://t.co/s4L9yYR6MU 4 years 14 weeks ago
  • Exploring The Raspberry Pi 4 USB-C Issue In-Depth | Hackaday - https://t.co/2Y57LjxOmQ 4 years 15 weeks ago
  • Did I already retweeted that ? "Bad Map Projection: South America" - https://t.co/N3Nr74Y6t3 4 years 15 weeks ago
  • Bad Map Projection: South America - https://t.co/N3Nr74Y6t3 4 years 17 weeks ago
  • It's never too late to learn : very good introduction to #Bluetooth #security and pairing - How Bluetooth works - https://t.co/tru1Jm3kza 4 years 17 weeks ago
  • People who make laws on things they don't understand; just the same all over the world unfortunately - https://t.co/Otc4fkhXi5 4 years 18 weeks ago
  • RT @tewoz: Demain, lancement officiel de ma campagne de crowdfunding pour mon recueil de strips « Comme un Lundi » ! Je compte sur vous pou… 4 years 24 weeks ago
  • Found that in my old CD tower. Noticed the penguin ? Yes it's a #Linux version of #Tribes - Still one of the best g… https://t.co/4QEzHVXhmO 4 years 26 weeks ago
  • RT @esascience: In this #Hubble image, a very distant galaxy – nicknamed the Sunburst Arc – appears at least 12 times 4 years 27 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