BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-02-2010, 07:46 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default END Call button event issue.

Please Login to Remove!

Hi All,

I am writting an application for Strom 2 9520. My application is a background application & it uses the PhoneListener events. When user dials a number, my application captures "CallInitiated" event. Then, in my code, I disconnect the call & in "callDisconnected" event, I displayed a message "Call Disconnected".
On simulator it works fine. But , whne I load the application on device, it doesn't work properly.
When I run on device, & make a call, "Callinitiated" event occurs, but call doesn't disconnected.


Following is the code I wriiten to disconnect the call:
EventInjector.KeyCodeEvent ev = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEv ent.KEY_DOWN, ((char)Keypad.KEY_END), KeypadListener.STATUS_NOT_FROM_KEYPAD);

EventInjector.invokeEvent(ev);
**********************************************

I think, my code doesn't trigger the END key. But it works fine on simulator.

Please help me. Thanks in advance.
Offline  
Old 08-02-2010, 09:19 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Most likely, event injection is disabled in the application permissions.
Offline  
Old 08-03-2010, 12:16 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 9000
Carrier: Airtel
Posts: 81
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

yeah in real device you have to enable key event injection.
Options => Advanced Options => Applications => [Your Application] =>Edit Default permissions =>Interactions =>key stroke Injection

read this article.
How to disconnect a call in blackberry
__________________
blog.vimviv.com
Offline  
Old 08-03-2010, 04:25 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
Thanks for the quick reply. I have set permissions on my device as per your suggestions. But, is there some way such that user don't need to change the permission, i.e. ,is there some way to set this permission programatically or while loading the application onto the device.

Secondly, after setting the permission, when my application presses END key, device shows some "Security" message everytime. Is there some way to get rid of this message?

Thanks again for your replies.
Offline  
Old 08-03-2010, 04:26 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 9000
Carrier: Airtel
Posts: 81
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

In that article itself given a second way.
by pressing end menu option for that you no need set any permission.
__________________
blog.vimviv.com
Offline  
Old 08-03-2010, 05:11 AM   #6 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for reply.

I tried the second option. But it didn't work properly. I tried on simulator & simulator hangs. I tried to debug it, but didn't find properly reason.
menu.getSize() return 12. So the loop runs 12 times. In the loop, there is print statement. All the 12 prints get printed, but no item has value 69632.
************************
menu 0 :4096 - Help
menu 1 :70224 - Flash
menu 2 :71760 - Enhance Call Audio
menu 3 :71936 - Mute
menu 4 :77824 - Notes
menu 5 :1441792 - Activate Speakerphone
menu 6 :16777280 - View Contacts
menu 7 :16777280 - View Calendar
menu 8 :16777280 - View Messages
menu 9 :268500997 - Show Dialpad
VM:+CR
VM:-CR=0
menu 10 :268501000 - Switch Application
menu 11 :268501008 - Home Screen
************************
Can you please elaborate further, where I am wrong.

Thanks

Last edited by smokingfly : 08-03-2010 at 05:17 AM.
Offline  
Old 08-04-2010, 01:41 AM   #7 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

Please help me. I am still finding the solution.

Thanks & Regards
Offline  
Old 08-04-2010, 01:57 AM   #8 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 9000
Carrier: Airtel
Posts: 81
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

yeah i have tested on storm its not working for storm.
__________________
blog.vimviv.com
Offline  
Old 08-04-2010, 02:19 AM   #9 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for reply.

Is there any other way to do this?
Offline  
Old 08-04-2010, 03:53 AM   #10 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

In real device I have to enable key event injection as per the steps told above.
Options => Advanced Options => Applications
=> [Your Application] =>Edit Default permissions =>Interactions =>key stroke Injection

Is it possible to enable it through application?

Thanks
Offline  
Old 08-04-2010, 08:25 AM   #11 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

See the class ApplicationPermissions and ApplicationPermissionsManager

You cannot set these without user intervention, but these classes allow you to set up the permissions, then prompt the user to "accept" them (rather than making the user go set them manually).
Offline  
Old 08-05-2010, 12:02 AM   #12 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Thanks to you all. I have done that using ApplicationPermissions and ApplicationPermissionsManager.

Thanks once again.
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.