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
New Developer
Posts: 27
Registered: ‎04-09-2009
My Device: Not Specified
Accepted Solution

Event Injection with JDE - 4.5.0 on 8300 simulator

Greetings,

I am using JDE 4.5.0 and default(8300) simulator to test following code placed in callInitiated(...) handler.

 

UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { EventInjector.KeyEvent inject = new EventInjector.KeyEvent (EventInjector.KeyEvent.KEY_DOWN, Characters.ESCAPE, 0, 50); inject.post(); inject.post(); } });

the above event injection is not working. Code placed inside run does not disconnect the call. 

 

I have confirmed the app has Event Injection permissions,via "Options->Advanced Otions->Applications.." as well as using ApplicationPermissionsManager class.

 

There seems to be numerous posts around this area and what I infered is that the device/runtime behavior is extremely inconsistent across JDEs.

 

Can someone hint what I might be missing in my above code? Smiley Sad

 

Thanks,
-/FH

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

Re: Event Injection with JDE - 4.5.0 on 8300 simulator

I think invoke later waits for the call to finish ..

 

Thanks!

 


Note, I'm signing off .. I'll reply once when I log in .. 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

Use invokeAndWait instead and let me know..

 

Cheers.. 

--
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 for the reply.

 

I tried invokeAndWait and seems like invokeLater after I dial a nummber it waits for input on "call Answer" dialog started by simulator.

 

The EventInjection code is executed in both the cases(invokeWait, invokeLater) but seems to have no effectivity.

 

-/FH

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

Re: Event Injection with JDE - 4.5.0 on 8300 simulator

You just don't get any response right? No errors or exceptions?
--
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

[ Edited ]

Forgot to ask, Is your application an UiApplication or just a background application?

 

Cheers.. 

 

EDIT: Have not noticed that it is an UiApplication.. 

Message Edited by mantaker on 04-17-2009 01:12 PM
--
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

Sorry for the above post, Yours seems to be an UiApplication.. The point I would like to comment here is when a call is incoming, it is a supervisory interrupt and your application will however stopped(or paused) till the control comes back to your application.. So AFAIK this cannot be done like this.. I think you have to implement a phone listener and do these key injection part of the events that are raised and that is what you need...

 

Cheers.. 

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

 

Sorry if it wasn't clear in my post, also I didn't mention it explicitly, that it is a UIApplication.

 

Let me confirm, were you suggesting, in your previous post that this app must implement a phoneListener interface?  Please correct me.

 

Then yes, indeed, it does implement phoneListener. Infact, the code listed in my original post is executed as a part of the callInitiated function.

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

Re: Event Injection with JDE - 4.5.0 on 8300 simulator

Yes I was saying that.. Have you debugged your application with break points and are you sure that the key inject has been made and has no effect on the call?

 

Cheers.. 

--
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

[ Edited ]

Yes I have debugged the app with breakpoints to ensure the event injection code is executed.

 

To answer what you had asked a while ago, no, I do not get errors/exceptions.

 

Thanks.

Message Edited by FrugalHorn on 04-17-2009 04:56 AM