I went looking for a way to uniquely identify an android device, and found android.provider.Settings.System.ANDROID_ID.

My immediate questions were, is it tied to the SIM card? Running code to print it out with and without the SIM card in the G1 result in the same number, so it looks like it is unique to the device as far as I can tell.

You can get it like this:

import android.provider.Settings.System;
String android_id = System.getString(this.getContentResolver(), System.ANDROID_ID);