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: 1,531
Registered: ‎07-14-2008
My Device: Z10

Re: Reject a call Programatically

just curious.  how do you stop the Phone app from playing the ringtone and use your own using your method? thx
Developer
Posts: 293
Registered: ‎02-25-2009
My Device: Not Specified

Re: Reject a call Programatically

Hey,

 

Just use the same code.And in startNotification() method , start a player with your custom ringtone. it will override the default ringtone of phone app.

Developer
Posts: 1,531
Registered: ‎07-14-2008
My Device: Z10

Re: Reject a call Programatically

thx. i will try this.

 

 

New Developer
Posts: 2
Registered: ‎07-29-2009
My Device: Not Specified

Re: Reject a call Programatically

I tried use the example to replace a call ringtone with my own sound but I have playng both sounds in the same time (the call ringtone + my sound playing through a player). Is there any way to remove events that start the call ringtone? Is there any document describes the inside blackberry notification mechanism?
Developer
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: Reject a call Programatically

Hmm...

this thread definitely gave out an interesting approach.... but has anyone succeeded ?

 

I still have to grasp the whole concept to truely understand why it fails (I didn't play anything in onNotification() though) and what it, in fact, does.

 

Thanks for the tip.



"Listen carefully, I shall say this only once"
New Developer
Posts: 27
Registered: ‎12-31-2008
My Device: Not Specified

Re: Reject a call Programatically

I'm having the same problem as described by   raydac.  I can start my own player in the startNotification method with a custom ringtone but the ringtone as set in the sound profile mixes with mine.

 

Has anyone found a way to stop the default ringtone?

 

Thanks.

Developer
Posts: 293
Registered: ‎02-25-2009
My Device: Not Specified

Re: Reject a call Programatically

NotificationsConstants.FORCED

 

This will stop the default ringtone :smileyhappy:

Developer
Posts: 109
Registered: ‎02-09-2009
My Device: Not Specified

Re: Reject a call Programatically

How do you use this constant?

Developer
Posts: 293
Registered: ‎02-25-2009
My Device: Not Specified

Re: Reject a call Programatically

NotificationsManager.registerSource(NOTIFICATIONS_ID_1, new Object() { public String toString() { return "Profile 1"; } } ,NotificationsConstants.FORCED); NotificationsManager.registerConsequence(ConsequenceImpl.ID, new ConsequenceImpl()); NotificationsManager.triggerImmediateEvent(NOTIFICATIONS_ID_1, 0, this, null);

 

 

 

I mentioned it in above with code too :smileyhappy: See the entire code.

 

 

Thanks,

Amardeep

New Developer
Posts: 27
Registered: ‎12-31-2008
My Device: Not Specified

Re: Reject a call Programatically

Thanks Amardeep,

 

Yes, I set the registration level to NotificationsConstants.FORCED. I think my problem is somewhere else so I took a step back. I ran the demo as delivered with the JDE component pack for eclipse. My environment is:

Eclipse SDK Version: 3.4.2

BlackBerry JDE Plug-in for Eclipse Version:  1.0.0.67

BlackBerry JDE Component Pack Version:  5.0.0.7

Simulator: 9700 v5.0.0.228

 

When the notification event is triggered using triggerImmediateEvent the startNotification method runs and the tone is played but then an IllegalArgumentException is thrown. Using the debugger with the simulator I see the following trace:

 

Thread [net_rim_bb_profiles_alertengine_app(64)id=181891072] (Suspended (exception IllegalArgumentException))    
    ProfileExceptionsImpl.getException(int, long, boolean) line: 739    
    AlertConsequence.processNotification(long, Object, boolean) line: 331    
    AlertConsequence$ProcessNotificationThread.run() line: 628    

Is this only seen with OS 5.0? Can you offer any advice on what to do here?

 

Thanks.