The geek meets the pickup artist

If you are anything like me, you get a lot of phonenumbers. And you’re often drunk. This combination of traits results in a huge number of contacts on your phone, and a lacking ability to remember who is who.

I’ve always wanted a feature for my cellphone: The ability to see the timestamp on your contacts. The idea being that if I knew when I added a number, I’d somehow remember who the person is.

Now, the iPhone doesn’t really have this feature. It stores the time when a contact is added to the Address Book, but to my knowledge it has no ability to actually list this information out. If there is a way to do it, please enlighten me.

All is not lost, however. On a jailbroken iPhone with SSH installed, you can quite easily retrieve the database from the iPhone 3G using scp.

From Settings, find which IP the iPhone has been assigned, and simply:

$ scp root@[iPhoneIP]:/private/var/mobile/Library/AddressBook/AddressBook.sqlitedb .

On a normal iPhone, the root password is “alpine”.

Now you can simply:

$ sqlite3 AddressBook.sqlitedb
sqlite> SELECT First, Last FROM ABPerson ORDER BY CreationDate;

And you’ll find that the most recently added contact in your address book are listed at the bottom of the list.

Obviously, installing SQLITE command line for the iPhone will allow you to do the same thing without copying the file to your local harddrive.

I’m toying the the idea of making an app for the iPhone which also stores location where you are when you add a contact, and istead of a simple “Add”-button, actually forcing the user to take a picture to add the contact.

Selecting the CreationDate also, will give you the exact time when the contact was added. It is stored as an integer indicating the number of seconds since 01/01/2001 00:00 GMT. Example:

Julia|Baby|245451346

This means Julia was added to the addressbook on Tue, 11 Oct 2008 20:55:46 GMT. To do this conversion, you can use a standard UNIX time converter, for example:

http://www.onlineconversion.com/unix_time.htm

And add 31 years to the year output from the converter (UNIX time is number of seconds since 01/01 1970 00:00).