Java tutorial
//package com.java2s; import android.content.Context; import android.provider.Settings; public class Main { private static String sAndroidID; public static String getAndroidID(Context applicationCtx) { if (sAndroidID != null) { return sAndroidID; } sAndroidID = Settings.System.getString(applicationCtx.getContentResolver(), Settings.System.ANDROID_ID); return sAndroidID; } }