Jump to Navigation

Me on Twitter

  • Nowadays you have to use a #passwordmanager, that makes no doubt. It's a pitty because this builds up a very sensit… https://t.co/JYPA7qbGve 2 years 12 weeks ago
  • RT @esascience: 2 years 22 weeks ago
  • RT @lexfridman: I don't trust my brain. It often generates weird, contradictory, and confusing thoughts. Plus it randomly interrupts a cohe… 2 years 25 weeks ago
  • énergie gratuite ! 2 years 28 weeks ago
  • @DianeDCD énergie gratuite ! 2 years 28 weeks ago
  • RT @clochix: Ça y est, MDN Plus est disponible en france, vous pouvez à présent soutenir financièrement cet effort pour proposer une docume… 2 years 30 weeks ago
  • @elonmusk @BTC_Archive Don't spend your money, there is already a platform for freedom of speech #mastodon https://t.co/0MXYtfx1HP 2 years 32 weeks ago
  • RT @LavanyaSunder: Grateful and humbled to announce that I am one of the most powerful humans in the world https://t.co/z6eVcg5JIX https://… 2 years 36 weeks ago
  • RT @Fighters_Gen: 2 years 40 weeks ago
  • RT @StreetArtUtopia: This mural reveals its full meaning when looking at its reflection in the water. https://t.co/jzfaqF6xng 2 years 43 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