Tuesday, January 19, 2010

Notification services

It is couple of weeks ago I have uninstalled IM+ instant messenger from my Android-powered phone. Due to excesive power consumption the application could easily exhaust my battery just overnight.
Messaging application is something I am really excited about. Idea of 5 or more simultanously running applications acting like IM+, however, is a battery overkill. No doubt: each messaging application must employ very similar notification code which polls server to return as soon as message becomes available. More such applications are running simultaneously the more CPU cycles are needed and more time spent on radio result in higher power consumption.
Then I was thinking, why it is needed five applications to do the same, power-intensive tasks where just single background service could manage it all. Right after I remembered iPhone and his notifications so much disregarded in many discussions. At the end of the day, the idea is not such bad :-) I am really wondering if such thing does not already exist for Android platform.

Generally, idea is simple: remote application server wants instantly notify mobile application client on some event. In case of we are running five or more of such applications, all need to contact respective server on their own, create socket connection and wait for response. Because all problems in computer technology are solved by another layer of indirection, why not have just single notification server and single network connection to it. On client side, Android service would dispatch messages to respective application listeners. This way not only mobile application get simpler. Moreover, only one network-aware code employs CPU at time and only single thread utilizes radio network hardware. In current stage of concept, notifications are meant as a vehicle for URLs which could be used to extract actual message payload from actual application server.

Followers

About Me

Peter is a technology enthusiast excited about internet and telecommunication technology which brings new quality of life to our everyday lives. 10+ years software 'veteran', former Oskar, Vodafone and IBM employee in area of service delivery platforms design and development. Started writing his first Basic code at age of 12, through Java, Enterprise Java and Android, Peter is now exploring ways how to bring all of these power toys to the real work.