BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 08-02-2010, 07:46 AM   #1
smokingfly
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
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
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

Most likely, event injection is disabled in the application permissions.
Offline  
Old 08-03-2010, 12:16 AM   #3
vivartpandey
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 9000
Carrier: Airtel
Posts: 81
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
smokingfly
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
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
vivartpandey
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 9000
Carrier: Airtel
Posts: 81
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
smokingfly
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
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
smokingfly
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
Default

Hi

Please help me. I am still finding the solution.

Thanks & Regards
Offline  
Old 08-04-2010, 01:57 AM   #8
vivartpandey
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 9000
Carrier: Airtel
Posts: 81
Default

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

Thanks for reply.

Is there any other way to do this?
Offline  
Old 08-04-2010, 03:53 AM   #10
smokingfly
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
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
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
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
smokingfly
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Storm
PIN: N/A
Carrier: Vodafone
Posts: 16
Default

Hi,

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

Thanks once again.
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


1pcs used TSXMFPP128K Memory Card picture

1pcs used TSXMFPP128K Memory Card

$175.00



Memory Module A20B-3900-0224 1Pcs Fanuc  rc picture

Memory Module A20B-3900-0224 1Pcs Fanuc rc

$472.67



HP E93839 FXN1 Motherboard w/ Intel i5-2500 3.6GHz - 4GB Memory picture

HP E93839 FXN1 Motherboard w/ Intel i5-2500 3.6GHz - 4GB Memory

$50.00



We R Memory Keepers - 12x12 Accordion Paper Storage - White Cream 60000274 picture

We R Memory Keepers - 12x12 Accordion Paper Storage - White Cream 60000274

$29.99



Argolladora We R Memory Keepers Heidi Swapp Cinch Binding Machine 71050-9 by AC picture

Argolladora We R Memory Keepers Heidi Swapp Cinch Binding Machine 71050-9 by AC

$79.99



NEW Original Allen Bradley 2080-MEMBAK-RTC Memory Module With RTC Plug-In picture

NEW Original Allen Bradley 2080-MEMBAK-RTC Memory Module With RTC Plug-In

$288.89







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