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,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Event Injection with JDE - 4.5.0 on 8300 simulator

[ Edited ]

Try putting a dialog and see if it is being showed.. Also I assume that you know the callInitiated is a method which listens for outgoing calls from your handheld..

 

Cheers.. 

 

EDIT: That is call being initiated from your side..

Message Edited by mantaker on 04-17-2009 02:50 PM
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
New Developer
Posts: 27
Registered: ‎04-09-2009
My Device: Not Specified

Re: Event Injection with JDE - 4.5.0 on 8300 simulator

>>That is call being initiated from your side..

 He..he..thanks. I know you trying to ensure everything.

 

To sum up everything let me put the sequesnce of execution,

1. After the simulator is started, sometime my app's main function breakpoint is hit.

2. From homescreen I dial a number.

3. callInitiated breakpoint is hit.

4. I do single stepping to reach the event injection code.

5. Single step the event injection code.

6. After the injection is posted, wait for the dialed call to disconnect.

 

Like you suggested, I inserted a dialog before each line in the "EventInjection code" block. The code now looks like below,

 

Dialog.alert("Preparing injection"); EventInjector.KeyEvent inject = new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_DOWN, Characters.ESCAPE, 0, 0); Dialog.alert("Before injection"); inject.post(); Dialog.alert("After injection");

 

Observation:- The control does not come back to the function after inject.post()

 

Thanks,

-/FG

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Event Injection with JDE - 4.5.0 on 8300 simulator

You want to inject end call button to disconnect the call?
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Highlighted
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Event Injection with JDE - 4.5.0 on 8300 simulator

I assume that you want to cut the call that is initiated.. If I'm right, use the following code to attain it..

 

 

EventInjector.invokeEvent(new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_DOWN, ((char)Keypad.KEY_END), KeypadListener.STATUS_ALT));

 Cheers...

 

 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Event Injection with JDE - 4.5.0 on 8300 simulator

In addition if you want to inject the escape key use "KEY_ESCAPE" instead..

 

Hope this is the requirement.. Cheers Smiley Wink 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
New Developer
Posts: 27
Registered: ‎04-09-2009
My Device: Not Specified

Re: Event Injection with JDE - 4.5.0 on 8300 simulator

mantaker thanks very much. The KEY_END insertion worked.

 

Smiley Very Happy

 

-/FH 

 

PS - Will investigate Escape key as well and will post the results here.

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Event Injection with JDE - 4.5.0 on 8300 simulator

When the call is in the state of initiated, then the Escape key injection will get you Task Switcher in front of the screen..

 

Cheers, and glad that you got worked it out Smiley Happy 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group