02-10-2010 01:20 AM
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
02-10-2010 03:17 AM
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.