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
New Developer
Soleil
Posts: 12
Registered: ‎09-03-2008
My Device: Not Specified

Re: get phone number

You can monitor CallLog folder and get phone number from a CallLog object.
Ex;

 

public void callLogAdded(CallLog cl){ if(cl instanceof PhoneCallLog){ PhoneCallLog pcl = (PhoneCallLog)cl; PhoneCallLogID pclID = pcl.getParticipant(); String adrPhoneNum = pclID.getAddressBookFormattedNumber(); String phoneNum = clID.getNumber(); String adrName = pclID.getName(); }else if(cl instanceof ConferencePhoneCallLog){ //TODO } }


I don’t know why you want to monitor a phone call/phone number in callDisconnected(…) method but 1 fact is a callLogAdded(…) invoked to add a new call log after a call/conference call is disconnected in a few milliseconds.

If you really want to monitor a phone object in callDisconnected(…) method then you can parse string only.
Hope this help.

 

i-softwarelabs
Please use plain text.
Developer
mbasheerk
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified

Re: get phone number

if I use the public void callLogAdded(CallLog cl) it will work every time when log is added but I need only when a call is answered and disconnected but not when a log is added due to busy or when a log added due to missed call
Please use plain text.
Developer
mbasheerk
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified

Re: get phone number

I have implemented phonelistener interface and using

callDisconnected

callConnected

methods,

but these methods works three times while calling?

and I set Phone.addPhoneListener(callListener); only once.

thanks

Please use plain text.