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);
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?
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..
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
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).