1
2
3
4
5
import android.telephony.TelephonyManager;

public String getIMEI() {
return ((TelephonyManager) mainActivity.getContext().getSystemService("phone")).getDeviceId();
}

需要权限 <uses-permission android:name="android.permission.READ_PHONE_STATE" />