07-07-2009 12:28 AM
I need to determine if the user has changed the simcard between reset, I do this by checking if the imsi has been changed by calling SIMCardInfo.getIMSI(). This worked nicely most of the time.
But on the simulator(4.3.0 8330) configured to use a CDMA network, I got UnsupportedOperationException when trying to call SIMCardInfo.getIMSI(). I also tried calling CDMAInfo.getIMSI() but later discovered that CDMAInfo.getIMSI() is not the same as SIMCardInfo.getIMSI().
Can someone tell me if this UnsupportedOperationException will be also happen on a real device, or if there is any other way to uniquely identify a simcard regardless of network type.
05-12-2010 02:04 PM
IMSI is available on CDMA phones. The reason you are getting that exception is that CDMA phones do not have a sim card. Instead detect which type of network it is by using RadioInfo.getNetworkType(). If it is a CDMA network then call CDMAInfo.getIMSI();