IMEI Android

Can i find the IMEI for Android in Unity?

I found an example for the Android_ID for Unity:

AndroidJavaClass up = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentActivity = up.GetStatic<AndroidJavaObject> ("currentActivity");
AndroidJavaObject contentResolver = currentActivity.Call<AndroidJavaObject> ("getContentResolver");  
AndroidJavaClass secure = new AndroidJavaClass ("android.provider.Settings$Secure");
string android_id = secure.CallStatic<string> ("getString", contentResolver, "android_id");

Can i find the IMEI with this method and modify this code??

I found also the code in Eclipse to find the IMEI code.

TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String IMEI = tm.getDeviceId();

Who can help? Thank you!

AndroidJavaObject TM = new AndroidJavaObject(“android.telephony.TelephonyManager”);

string IMEI = TM.Call<string>("getDeviceId");

Previous answers work only for old devices (API < 26) and even for these devices sometimes empty string is returned. Right solution that always works is to receive TelephonyManager from CurrentContext:

 using (var currentActivity = GetCurrentActivity())
        using (var contextClass = new AndroidJavaClass("android.content.Context"))
            string telephonyServiceName = contextClass.GetStatic<string>("TELEPHONY_SERVICE");
            using (var telephonyManager = currentActivity.Call<AndroidJavaObject>("getSystemService", telephonyServiceName))
                    return GetSdkLevel() >= 26
                        ? telephonyManager.Call<string>("getImei", 0)
                        : telephonyManager.Call<string>("getDeviceId");
    private static int GetSdkLevel()
                var buildVersionClass = AndroidJNI.FindClass("android/os/Build$VERSION");
                var sdkIntField = AndroidJNI.GetStaticFieldID(buildVersionClass, "SDK_INT", "I");
                return AndroidJNI.GetStaticIntField(buildVersionClass, sdkIntField);