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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 374
Registered: ‎04-07-2010
My Device: Bold 9000
My Carrier: Airtel
Accepted Solution

Problems in Phone Listener

Hello  Every one...

 

 I am working on a project in which i need to take a Real-Time log of all incoming and outgoing calls and missed calls...

I am using Phone Listener for that but I am getting few problems with it...

 

1) public void callInitiated(int callId)  is invoked twice for every call initiated...

 

 

 public void callIncoming(int callId) {
        
          checkCall2("call Incoming", callId); 
         
    }
public void callInitiated(int callId) { 
            
          
         checkCall2("call Initiated", callId);
          
    }

 

 

 Whereas I use the same function in  public void callIncoming(int callId) which performs normally(once for every call) !!

 

2) I need to get the Duration of the calls when calls are ended.. I am Using

 

 public void callDisconnected(int callId)  &

 public void callEndedByUser(int callId)

 

in following manner:

 

 

public void callDisconnected(int callId) {
        
          PhoneCall callInfo = Phone.getCall(callid);
          
          int elapsedOut = callInfo.getElapsedTime();
          
          String  phoneNumberOut = callInfo.getPhoneNumber();
    }

 But its always throwing NullPointer Exception for "callInfo"...

 

I don't know why its happening... and If this is not the right way to achieve this, then please show me the right way.... Please Help!!!

 

Thank you  in Advance...



Press the Like button (Thumb up) on the left side to thank and
please mark the Thread as solved if its solved...
K.S
Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Problems in Phone Listener

the callInitiated bug is known, you have to implement a safeguard (timestamp, or a boolean in conjunction with the callId).

 

but why don't you use the phoneloglistener? you get all information you need there, don't you?

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 374
Registered: ‎04-07-2010
My Device: Bold 9000
My Carrier: Airtel

Re: Problems in Phone Listener

Thanks For the Reply Simon...

 

I was not knowing about Phoneloglistener... I will try that now...

I just need number, duration and Time/Date of the logged call... I can see methods for duration and Time/date but how to get number from that??

 

Thank you in advance...

 

Regards....

 

Press the Like button (Thumb up) on the left side to thank and
please mark the Thread as solved if its solved...
K.S
Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Problems in Phone Listener

http://www.blackberry.com/developers/docs/5.0.0api/net/rim/blackberry/api/phone/phonelogs/PhoneCallL...()

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 374
Registered: ‎04-07-2010
My Device: Bold 9000
My Carrier: Airtel

Re: Problems in Phone Listener

Thank you Simon....

 

I will give it a try today... will post again if i get a Problem....

 

Thanks A lot...

 

Regards

Press the Like button (Thumb up) on the left side to thank and
please mark the Thread as solved if its solved...
K.S