These days I’m bumping in to a LOT of people using iPhones and loving them. The most happy iPhone users are the ones who have jailbroken their phones and now are able to stream live video recording and to access stuff that was locked down on their phone to begin with.
One of the things that they still envy Android users for is the high degree of pluggability that allows Android developers access to phone services such as the ability to react to an incoming call on the phone.
LookupIncomingCall is an Android application that uses this feature to look up names for any incoming call on the yellow pages of some countries.
When a new call is received the application simply does a lookup on a national yellow pages service and returns the name of the caller if found.
This is a very handy application to add to your phone and in the current version (1.6) it supports a number of yellow page listings in the US, Sweden, Germany and Denmark.

As you can see in the screenshot above, the LookupIncomingCall application looks up the number on a phone listing service and the name found is displayed in the notification bar at the top.
LookupIncomingCall supports a number of yellow page services, but the developer has been so kind to allow custom services to be added to the list as well.
This allows developers to plug in custom services for looking up numbers that are not known on public yellow page listings, such as internal phone numbers in a company.
I decided to put together a small program to look up internal phone numbers in my company.
My company uses 3 digit numbers when colleagues need to call each other, so my boss can be reached on the number 200 for instance.
I wrote some code that takes the phone number as input parameter and simply determines the length of the number to decide whether it’s internal or external.
The code below is deployed on Google App Engine at this location http://lookuplocalnumbers.appspot.com/ and the servlet containing this is mapped to the URL /number – not very imaginative, but hey it’s easy to remember
The service can be called like this http://lookuplocalnumbers.appspot.com/number?number=73720000
returning the name of my favourite local pizza guy !
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String number = request.getParameter("number");
String name = "Not listed";
//local number ?
if (number.length() == 3) {
if (number.equals("200")) {
name = "The big boss";
} else if (number.equals("214")) {
name = "The REAL boss";
}
//and so on.....
} else {
if (number.length() > 3) {
name = call118(number);
}
}
ServletOutputStream out = response.getOutputStream();
out.println(name);
}
The code above contains a very short lookup list of two persons – one is my boss, and the number 214 is my dear colleague who is responsible for my monthly paycheck, thus – The REAL boss
If the number given is longer than 3 digits the lookup is redirected to 118.dk, a Danish yellow page service and finally the results are simply printed out, which makes the LookupIncomingCall application display the results in the notification bar.
Simple, fast and useful
So the above application is not very useful before you can tap into the complete phone directory of your company – the next person you definitely want in that directory, is the accountant who always calls you at the end of the month to complain about missing bills for your expense report
But, the sample shows how easy it is to patch a few lines of code together an connect data with the inner workings of your Android based phone.
And this is really the true force behind an open mobile operating system like Android, because it allows you to modify the behaviour of your phone.
And – if you are a gadget addict like me – you bring the application to your next Android phone, when you decide to switch for the newest shiny Android phone on the market!

