Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
ganeshS
Posts: 133
Registered: 12-31-2009

How to receive the incomming call automatically

Hello Friends,

        I want to receive the incomming call without user interface. I am using following code to receive the call without user interface. This code works unpredictabally (sometimes it receive call and some times it does not receive )

								EventInjector.KeyCodeEvent ev = new EventInjector.KeyCodeEvent(
										EventInjector.KeyCodeEvent.KEY_DOWN,
										((char) Keypad.KEY_SEND),
										KeypadListener.STATUS_NOT_FROM_KEYPAD,
										10);
								EventInjector.invokeEvent(ev);
								EventInjector.KeyCodeEvent ev1 = new EventInjector.KeyCodeEvent(
										EventInjector.KeyCodeEvent.KEY_UP,
										((char) Keypad.KEY_SEND),
										KeypadListener.STATUS_NOT_FROM_KEYPAD,
										10);
								EventInjector.invokeEvent(ev1);

								// LogWrite("after keyinjector");
							

 

I have also used InvokeLater and I got same result as above.

 

 

 

 

Thanks

Please use plain text.
Developer
simon_hain
Posts: 10,780
Registered: 07-29-2008
My Carrier: O2 Germany

Re: How to receive the incomming call automatically

depending on the speed of the device you have to wait for 0.5-2 seconds to inject the green key. the incoming phone screen handles the accept/decline, it has to be pushed to the screen to consume the key.

put the wait into an own thread, otherwise you block the processing of the phone application.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

peter_strange wrote:
"This process should happen traumatically for you in both JDE and Eclipse."
Please use plain text.