Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 132
Registered: ‎05-07-2009
My Device: Curve
My Carrier: Vodafone

getIMSI giving exception

Hi Guys,

 

I am using GSM mobile phone.

My carrier is Etisalat

Blackberry model is 8900

 

I am having international roaming account.

 

My phone number has a SIM card but SIMCardInfo.getIMSI() is giving me exception.

 

Please help

Sameer Joshi
Blackberry developer.
Developer
Posts: 516
Registered: ‎07-23-2010
My Device: 9900

Re: getIMSI giving exception

What is the exception you are getting?

Are you roaming with a GSM carrier?

 

The more information you can provide the more we can help.

Developer
Posts: 132
Registered: ‎05-07-2009
My Device: Curve
My Carrier: Vodafone

Re: getIMSI giving exception

i did not check the exception, i cannot check it basically, because it is happening on a remote device, so i cannot debug it,

 

but what could be the causes? my method is as follows

 

public byte[] getSIMInfo()

{

byte[] imsi = null;

try

{

imsi = CDMAInfo.getIMSI();

}

catch(Exception e)

{

}

return imsi;

}

 

this method is returning me null; Smiley Sad ... please help me out

Sameer Joshi
Blackberry developer.
Developer
Posts: 516
Registered: ‎07-23-2010
My Device: 9900

Re: getIMSI giving exception

Here's what you need for GSM: You are using CDMA ONLY Smiley Indifferent

 

 

public byte[] getSIMInfo()
{
   byte[] imsi = null;
   try
   {
      imsi = CDMAInfo.getIMSI();
   }
   catch(Exception e)
   {
      try{
         imsi = SIMCardInfo.getIMSI();
      }
      catch(....){}
   }
   return imsi;
}

 

 

Developer
Posts: 516
Registered: ‎07-23-2010
My Device: 9900

Re: getIMSI giving exception

One more thing do you know what OS the 8900 is running?

Developer
Posts: 132
Registered: ‎05-07-2009
My Device: Curve
My Carrier: Vodafone

Re: getIMSI giving exception

oops sorry... i made a mistake in my previous post... i am using SIMCardInfo only....

 

8900 OS version is - 5.0.0.681

 

thanx for ur replies... but any suggestion here?

Sameer Joshi
Blackberry developer.
Developer
Posts: 516
Registered: ‎07-23-2010
My Device: 9900

Re: getIMSI giving exception

Yes try the code I wrote.

It will try to get the CDMA imsi and if it doesn't exist it will try to get the SIM card IMSI.

That should work. If not then you would need to debug the code on the device.

I know this code is being used in multiple applications and it's been working.