Jump to Navigation

Me on Twitter

  • Requirements for coronavirus disease 2019 (COVID-19) apps - Play Console Help - https://t.co/v6hbjtjAH5 2 years 15 weeks ago
  • Pas sûr que le père Noël passe cette année ? Rachetez-vous une conscience – Rallumez les ombres, faites un don à la… https://t.co/sb640Kp2e0 2 years 17 weeks ago
  • Alors que l'on critique l'hégémonie de #Google... https://t.co/0qlVXabFi0 2 years 17 weeks ago
  • @InfernoSchnapp ça fait un moment que je cherche comment le dire :-D 2 years 17 weeks ago
  • @petapixel you're right, stop depending a company and get back control on your photos : https://t.co/VAqBPAA2Uh @Pixelfed 2 years 19 weeks ago
  • RT @scott_kerr: Meanwhile, by Columbus Circle https://t.co/FRzWiCIqfa 2 years 20 weeks ago
  • @GregWildSmith Then continue to use it a lot... Maybe it's just that you haven't used it long enough ;-) 2 years 21 weeks ago
  • RT @iceland: Some said an open-world experience this immersive wasn’t possible. But it’s already here. And you don’t even need silly VR hea… 2 years 23 weeks ago
  • RT @okjanelle: I find this @snowden quote relevant. https://t.co/8VCBRbECta 2 years 24 weeks ago
  • Oh. My. God. Thx for this good laughing session 2 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