Jump to Navigation

Me on Twitter

  • mlocate will never ruin my evenings anymore ! UNINSTALLED ! https://t.co/07wCGOZv2Q 3 years 46 weeks ago
  • "failed to build cryptography" of course... 3 years 46 weeks ago
  • The worst is that I already know that I forgot some optional openssl dependencies and that I'll need to start again... 3 years 46 weeks ago
  • Building https://t.co/oTfN2b5DJ4 inside #docker on #armv7 ... Let's go to bed and see if it's done tomorrow morning… https://t.co/6xUegSZlZz 3 years 46 weeks ago
  • RT @Unexplained: Caption this! https://t.co/FobPIx7gXB 3 years 47 weeks ago
  • Nice pattern : proposing the user to test his password before disconnecting from an always-connected app #keybase #security 3 years 47 weeks ago
  • RT @esascience: These cosmic #fireworks are the motions of numerous stars at the outskirts of our Milky Way as measured by @ESAGaia! 3 years 47 weeks ago
  • Want to really understand how bitcoin works? Here’s a gentle primer | Ars Technica - https://t.co/7nVsFJzG8X 3 years 48 weeks ago
  • @MCetMOI Impossible d'installer l'appli sur un smartphone sans Google... Je crois que je vais arrêter là... Du mal… https://t.co/owPEvVJNXk 4 years 5 days ago
  • @MCetMOI Euh... Application d'authentification mise en avant sur des sites d'Etat mais certificat de… https://t.co/EDnElhpcZQ 4 years 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