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
dynamicdhaka
Posts: 101
Registered: ‎12-10-2009
My Device: styile 9670

"sim error in blackberry 8520"

i have a application which have phonelistener. it stays in background. so when we initiate a call from contact or from call log application automatically  hangup the call and popup a option  to user(yes/no) . when user select yes it make another call to a extension . sometimes i am getting "sim error" in blackberry 8520 when i select yes to make call to the extension. anybody have any idea why this is happening.....

Mobile Application Advisor
BlackBerry Development Advisor
MSohm
Posts: 14,757
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: "sim error in blackberry 8520"

What action is your application taking when you select yes?  Is it just trying to dial a number using the Phone class?  Does this device have multiple phone numbers you can dial from (MVS number and cellular number)?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
dynamicdhaka
Posts: 101
Registered: ‎12-10-2009
My Device: styile 9670

Re: "sim error in blackberry 8520"

Hi,

  i am just dialing another phone number. the interesting behavior is , the "sim error" is not happening all time. sometimes it is happening.I dont know whether the device have MVS number.how to check that.

my code snippet is here

 

if(m_CallBackDialler.getRouting().equals("Ask before each call")&&!is_initiated_first_Call)  
              {
                 is_initiated_first_Call=true;
                 injectEndCall();
                 
                 UiApplication.getUiApplication().invokeLater(
                    new Runnable(){
                           public void run()
                             {  
                              try
                                {
                                  Dialog box =new Dialog(Dialog.D_YES_NO,"Do you want to use our service?",Dialog.YES,iconForDialog,Dialog.VISUAL_STATE_NORMAL);
                                  int ret=box.doModal();
                                  switch(ret)
                                   {
                                    case Dialog.YES:
                                         String validNumber=ItelGetContact.checkForValidNumber(newNumber);
                                        if(!validNumber.equals(""))
                                          {
                                           is_initiated_second_Call=true;
                                           createNewGsmCall(makeDialNumber(validNumber));
                                          }
                                    else if(validNumber.equals(""))
                                          {
                                           is_initiated_first_Call=false;
                                           is_initiated_second_Call=false;   
                                          }  
                                    break;
                                 case Dialog.NO:
                                         is_initiated_second_Call=true;
                                         createNewGsmCall2(newNumber);
                                    break;   
                                  }       
                               }
                            catch(Exception ex)
                             {
                                 System.out.println("updateLoginStatus(String text)");
                             }
                      }    
                   }
                 );
                  
              
         }

 

 

//

ublic void createNewGsmCall(String number)
{
 
  try{
     number= number+"#";
     PhoneArguments call = new PhoneArguments(PhoneArguments.ARG_CALL, number,true);
     Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, call);   
  }catch(Exception ex)
  {
    is_initiated_second_Call=false;
    is_initiated_first_Call=false;    
  }
}
///


private void injectEndCall()
  {
         
         EventInjector.KeyCodeEvent pressEndKey = new EventInjector.KeyCodeEvent
              (
               EventInjector.KeyCodeEvent.KEY_DOWN,(char) Keypad.KEY_END, 0,0
              );
         EventInjector.KeyCodeEvent releaseEndKey = new EventInjector.KeyCodeEvent
             (
               EventInjector.KeyCodeEvent.KEY_UP,(char) Keypad.KEY_END, 0,0
             );
           EventInjector.invokeEvent(pressEndKey);
           EventInjector.invokeEvent(releaseEndKey);
   }


 

Mobile Application Advisor
BlackBerry Development Advisor
MSohm
Posts: 14,757
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: "sim error in blackberry 8520"

Programmatically you can use Phone.getLineId() to determine the number of phone numbers configured on the device.  getLineLabel and getLineNumber will give you a text description and phone number for each line.

 

If the user has a cellular number and an MVS number you'll get 2 results back from getLineId.

 

Does it make a difference if the user redials quickly or waits a few seconds before dialing out?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker