3

I have seen a lot of posts which says android documentation does not support dual sim phones.

In my case I want to identify the device so that i could store its IMEI on my server. But because phone might have dual sims, will using the code

android.telephony.TelephonyManager.getDeviceId()

will return the same IMEI each time I run it, or it may return 1st sim slots IMEI for one time and 2nd sim slot's IMEI the other time?

Because my app will check with server to give him access for running on that device. So in case the above line of code returns same sim slot's IMEI all the times, then I dont bother about phone having dual sim. Because I just want that I get the same IMEI which I saved during my apps first run on my server.

So in short I wanna know that running this code above will give me same IMEI for all the times OR will it give me IMEI of any sim slot randomly for different runs?

If I dont make myself clear, please let me know.

Anik Islam Abhi
  • 25,137
  • 8
  • 58
  • 80
Kshitij
  • 31
  • 1
  • 7
  • Do you have a phone with two sim card slots? – greenapps Nov 02 '14 at 09:12
  • yes i do... its Gionee E3... – Kshitij Nov 02 '14 at 09:45
  • me too have same query.. Waiting for Answers. – Vishal Nov 20 '14 at 07:34
  • Is there an answer for this? I also have a system that registers device id, so I depend on this call to return always the same IMEI... Unfortunately, we have a case that the user has registered with one IMEI, but then he couldn't access the application because suddenly the platform started to respond with IMEI from slot 2... Still looking for the causes to this problem... – ImNotAnUser Nov 16 '15 at 16:35

2 Answers2

0

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

so for each SIM you can get the IMEI.

amit
  • 1
  • 1
0

Prior to Android L there was no official support for Dual SIM phones. Since IMEI is tagged to specific SIM slot, the value returned by TelephonyManager.getDeivceId() varies with the slot in which SIM card is inserted.

You can check my SO where I have described the values returned by dual SIM phones prior to official support from Android OS, along with some workaround.

Note: Tablet without SIM card won't have IMEI

Sagar
  • 23,903
  • 4
  • 62
  • 62