In my application I need to get the SIM card number. I am getting that with SIMCardInfo.getIMSI()
, but in some other format.
My SIM number is 89919400002018929130, but I am getting: 404940.20.189291.3
I used the following code:
try
{
currentSimNo = GPRSInfo.imeiToString(SIMCardInfo.getIMSI());
}
catch (Exception e)
{
}
sampath says:
If I line up your two numbers and remove separators, it does look like they are roughly the same:
Where did you get the first one from?
In the Wikipedia article on IMSI, you can see that the first three digits are the MCC, then the second three are the MNC. So it looks like your SIM is from India, though I don't see a MNC that matches 940.
These values are frequently encoded as binary-coded decimal, which is why the imeiToString method needs to be used.
EDIT
The IMSI wikipedia article also mentions:
I think your code is returning the correct value as
404940201892913
. Whatever number you are trying to compare it to (899194...) must be encoded differently.The imeiToString takes a IMEI not a IMSI