Jump to Navigation

Me on Twitter

  • Corporate firewall blocking technical docs ? this bookmarklet shows a QRCode to scan & browse w/ur mobile device https://t.co/5iKy9wouPF 11 years 3 weeks ago
  • RT @TheBrousse: Creating Mobile Apps with Appcelerator Titanium is available now on Amazon! http://t.co/7apIeI9xPM 11 years 8 weeks ago
  • Direct URL : https://t.co/lvockaoeFB #GooglePlay #CandyCrushSaga 11 years 8 weeks ago
  • Also check out Candy Crush Unlimited for free lives https://t.co/Jd6wRO9Ct7 #CandyCrushSaga 11 years 8 weeks ago
  • Candy Crush Score 1.0.2 is on #GooglePlay #CandyCrushSaga 11 years 8 weeks ago
  • #CandyCrushSaga now has its #android app to compare your #scores and confront other players https://t.co/lvockaoeFB 11 years 10 weeks ago
  • How many hours lost on #android dev to find the right excludes with #proguard (even with Google's own support lib)... 11 years 11 weeks ago
  • Programming Handheld Systems with Android from @UofMaryland on @Coursera! https://t.co/T3Dcx6F3ZV #android 11 years 11 weeks ago
  • After several evenings fighting against proguard #AngryBirdsScore finally alpha ! http://t.co/istewvTFsH #angrybirds  #AngryBirdsStarWars2  11 years 12 weeks ago
  • Android workshop at @osaxis tonight ! 11 years 14 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