Jump to Navigation

Me on Twitter

  • Ah ah ah https://t.co/Ou3BoHpLA8 3 years 6 weeks ago
  • on the other hand, @AtomEditor's git GUI is very productive, so it still has my preference over @code 3 years 7 weeks ago
  • I wonder if #vscode users do use #git... The GUI is just impractical on a daily basis, I always end up switching to command line 3 years 7 weeks ago
  • Important to know that this exists ! This new technology called a "Speaking Portrait" allows any still photo to be… https://t.co/AP8GVnst2N 3 years 9 weeks ago
  • RT @Thom_astro: Le Vésuve et #Naples. Les montagnes sont toujours plus spectaculaires prises avec un léger angle qu’à la verticale parfaite… 3 years 9 weeks ago
  • Knew that already, but may be of some interest for tech beginners... https://t.co/9WIhTRIYyW 3 years 12 weeks ago
  • RT @stefanolaru: 3 hours of debugging can save you 5 mins of reading the docs. 3 years 12 weeks ago
  • Like a #scifi movie, except it's real 3 years 14 weeks ago
  • First paragraphs are just so confuse... Anyway the rest is a great & straight description of #sleep states in… https://t.co/dDLejX0SXO 3 years 14 weeks ago
  • RT @github: A pixel editor in the terminal? Why not! https://t.co/0d2xHvyyXJ 3 years 14 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