Java tutorial
//package com.java2s; import android.content.Context; import android.telephony.TelephonyManager; import android.text.TextUtils; public class Main { public static String getIMEI(Context mContext) { String str; str = ((TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId(); return TextUtils.isEmpty(str) ? "" : str; } }