Dual sim android phone always returns the same IMEI when using android.telephony.TelephonyManager.getDeviceId ()

I have seen a lot of posts saying that Android documentation does not support dual sim phones.

In my case, I want to identify the device so that I can store it IMEI

on my server. But since the phone can have dual sims, will use the code

android.telephony.TelephonyManager.getDeviceId()

      

will it return the same IMEI every time I launch it, or can it return the 1st SIM IMEI slot at a time and the 2nd SIM IMEI interval at a different time?

As my application will check the server to give it access to work on this device. So in case the above line of code returns the same SIM IMEI all the time, then I am not worried about the dual sim phone. Because I just want me to get the same IMEI that I saved during my applications first running on my server.

Long story short, I want to know that running this code above will give me the same IMEI

all the time OR will it give IMEI

any SIM slot randomly for different runs?

If I don't explain, please let me know.

+3


source to share


2 answers


android L TelephonyManager.java has API to get device for each slot.   public String getDeviceId (int slotId)



so for each SIM you can get the IMEI.

0


source


Before Android L, there was no official support for Dual SIM phones. Since the IMEI is tagged to a specific SIM slot, the value returned by TelephonyManager.getDeivceId () depends on the slot where the SIM is inserted.

You can check my fooobar.com/questions/2174866 / ... where I have described the values ​​returned by the dual SIMs before the official Android OS support and also some workarounds.



Note. A tablet without a SIM card will not have an IMEI

0


source







All Articles