BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-04-2008, 04:53 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2008
Model: 8800
PIN: N/A
Carrier: AT
Posts: 81
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default PhoneListener

Please Login to Remove!

Hi all,

In my application i am using PhoneListener events,even though i have implemented all the abstract methods of PhoneLlistener my application doesn't call each one when it is supposed to call the event.

In the document i didn't get the following 2nd step.
Can anyone of you tell me how to register the PhoneListener?


Listen for phone events.
>Implement the PhoneListener interface.
Register the phone listener.
>Invoke Phone.addPhoneListener().
Remove a phone listener.
>Invoke removePhoneListener().
Offline  
Old 11-04-2008, 04:53 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2008
Model: 8800
PIN: N/A
Carrier: AT
Posts: 81
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Any idea?
Offline  
Old 11-04-2008, 07:30 AM   #3 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

net.rim.blackberry.api.phone
Class Phone

static void addPhoneListener(PhoneListener pl)
Registers a phone listener with the system.
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 11-07-2008, 12:25 AM   #4 (permalink)
Knows Where the Search Button Is
 
jeet.bhatt@spec-india.com's Avatar
 
Join Date: Aug 2008
Location: India
Model: 8100
PIN: N/A
Carrier: Vodafone - India
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default phoneListener class

hi,
in my application, i've used following phoneListener class

i wrote the code to register a phonelistener just inside the class using static
hope this code may help u..

Code:

public class AddPhoneListener  extends AbstractPhoneListener {
    
    static public void registerOnStartup(){
        AddPhoneListener phone_handler = new AddPhoneListener();
        Phone.addPhoneListener(phone_handler);
        
    }
    
    public AddPhoneListener() {
    
    }
    
    private void checkCall(String ehandler, int callid){
         
    }
    
    //IMPLEMENTED LISTENER METHODS
    
    // A call has been added to a conference call
    public void callAdded(int callId)
    { checkCall("callAdded", callId); }
    
    // User answered a call
    public void callAnswered(int callId)
    {checkCall("callAnswered", callId); }
    
    // Conference call established
    public void callConferenceCallEstablished(int callId)
    { checkCall("callConferenceCallEstablished", callId); }
    
    // Network indicates a connected event
    public void callConnected(int callId)
    { checkCall("callConnected", callId); }
    
    // Direct-connect call connected
    public void callDirectConnectConnected(int callId)
    { checkCall("callDirectConnectConnected", callId); }
    
    // Direct-connect call disconnected
    public void callDirectConnectDisconnected(int callId)
    { checkCall("callDirectConnectDisconnected", callId); }
    
    // Call disconnected
    public void callDisconnected(int callId)
    { checkCall("callDisconnected", callId); }
    
    // User ended call
    public void callEndedByUser(int callId)
    { checkCall("callEndedByUser", callId); }
    
    // Call has been placed on "hold"
    public void callHeld(int callId)
    { checkCall("callHeld", callId); }
    
    // New call has arrived
    public void callIncoming(int callId)
    { checkCall("callIncoming", callId); }
    
    // Outbound call initiated by the handheld
    public void callInitiated(int callid)
    { checkCall("callInitiated", callid); }
    
    // Call removed from a conference call
    public void callRemoved(int callId)
    { checkCall("callRemoved", callId); }
    
    // Call taken off of "hold"
    public void callResumed(int callId)
    { checkCall("callResumed", callId); }
    
    // Call is waiting
    public void callWaiting(int callid)
    { checkCall("callWaiting", callid); }
    
    // Conference call has been terminated
    // (all members disconnected)
    public void conferenceCallDisconnected(int callId)
    { checkCall("conferenceCallDisconnected", callId); }
    
    // Call failed
    public void callFailed(int callId, int reason)
    { checkCall("callFailed", callId);}
}
__________________
Jeet
ORG::SPEC India
Ahmedabad. India
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.