Saturday, September 5, 2009

Android app Hunting Lines has been submitted as an entry into ADC2

Hunting Lines is an app that lets a user select a set of contacts and starts dialing them one after the other until one of them picks up the call. This was inspired by the problem of contacting LPG gas agencies and the like that have many phone lines that are always busy!

This app has been submitted as an entry into ADC2, which is the Android Developer Challenge 2 by Google.

Some problems/challenges we saw while making the app:
* There are internal APIs in the SDK that are invisible to developers like us unless there is a certificate that is the same as the one used by the Android core platform.

* What APIs did this app need: a way to reliably know the different phone states like call started, ringing, connected, disconnected, idle, missed etc. The only ones available are: off hook, idle and ringing. So, that was the first problem. So, how did we figure out if a call we initiated went through or not - a post by someone in Google (Megha Joshi) hinted at using call log for some question came as help. So, the app changed to look at the call log whenver the call state idle event is received. That worked!

* 2 phones had Android on them for testing - one was the openmoko phone and the other being the Android Dev Phone. One the openmoko, we used the alpha release of the cupcake version by Koolu. On this version, the app started to go from one number to the other perfectly until one of them connects.

The same thing did not work on the Android Dev Phone, why - after every call, we would end up seeing the call log screen that prevented the phone state idle event to be posted. So, you have to exit the call log screen to start dialing the next number!!! How dumb can that be specially when you want the app to be completely automatic. Any workarounds here - None!!! Just while searching for a workaround, I saw an email from someone (flohier) to the android developers forum stating the same problem and the failed attempts at getting it to work.

* At times during debugging, I would end up not seeing the app and we figured out that when Android loads, it would kill an app that does not have a certificate. I learnt this only while trying to submit the app and it threw an error saying it needs a self certified certificate.

Anyway, it is now in the contest. We plan to release the source and the apk into opensource in a day or two. We will post an update here. If you plan to use the source or the apk, please send an email to openologyATgooglegroups.com. Oh, and please send us some feedback if you use the app!
Update - here's the source - http://gitorious.org/hunting-lines
New home - http://firstpenguin.org/tiki-read_article.php?articleId=4

p.s: the name was coined by Praveen and the idea comes from Radha.