BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-28-2008, 01:18 AM   #1 (permalink)
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Speed Dial...

Please Login to Remove!

I want to implement speed dial functionality in my application...

please suggest how can I do that?
Offline  
Old 04-28-2008, 03:03 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

could you elaborate this a bit? should certain numbers be called on press of a key?
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 04-29-2008, 12:27 AM   #3 (permalink)
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

My application is also similar to a phone application...

Here also we have option to dial numbers.

When i keep a number digit pressed for a while in my application i want to initiate a call to the speed dial number assigned to that key...


I mean i want to invoke the native speed dial...
Offline  
Old 04-29-2008, 01:59 AM   #4 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i don't think this is possible as there are no PhoneArguments to invoke the phone application with speed dialing. I also don't know of any way to read the speed dialing settings, the only (dirty) possibility would be keystroke injection maybe.
Would it be much of a nuisance if you'd implement your own speed dial settings?
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 04-29-2008, 06:44 AM   #5 (permalink)
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

By Keystroke injection you mean EventInjection right?

I am not able to implement this technique.

Actually in my application there are around five feature which are still pending because i am not able to implement EventInjection (keycodeevent)...

like loudSpeaker, switch application, speed dial etc...

if you dont mind, can you please help me in implementing this...
Offline  
Old 04-29-2008, 08:25 AM   #6 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

code by fellow board member franktian to end a call using event injection:
Code:
EventInjector.KeyCodeEvent pressEndKey=new EventInjector.KeyCodeEvent(KeyCodeEvent.KEY_DOWN,(char)Keypad.KEY_END,KeypadListener.STATUS_NOT_FROM_KEYPAD,100);
EventInjector.KeyCodeEvent releaseEndKey=new EventInjector.KeyCodeEvent(KeyCodeEvent.KEY_UP,(char)Keypad.KEY_END,KeypadListener.STATUS_NOT_FROM_KEYPAD,100);
EventInjector.invokeEvent(pressEndKey);
EventInjector.invokeEvent(releaseEndKey);
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 04-29-2008, 08:35 AM   #7 (permalink)
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

End key i tried and its working in most of the simulators, but not in 8100 devices.

Can you please help me in doing EventInjection for Enabling loudspeaker and switch application...

I tried the key code key_speakerphone, but its invoking mute...

I am not able to inject the key combination key_alt+key_escape event(Switch application)
Offline  
Old 06-25-2008, 05:18 AM   #8 (permalink)
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question

I am trying to implement speed dial using keystroke injection....

but keyrepeat event is not caught by this method...

can anyone tell me what can be the reason...

Code:
phoneNumberField = new EditField("", "", 40, EditField.USE_ALL_HEIGHT
                                | EditField.USE_ALL_WIDTH | EditField.FILTER_PHONE) {
                        /**
                        * Speed Dial Implementation using keystroke injection
                        */
                        protected boolean keyRepeat(int keycode, int time){
                            System.out.println("KeyRepeat : "+ keycode);
                            if(phoneNumberField.getText().length()==1 ){                    
                                    ApplicationHandler.setApplicationToBackground();                        
                                    try{
                                        Thread.sleep(500);
                                    }catch (Exception e) {}                                         
                                    
                                    EventInjector.invokeEvent( new EventInjector.KeyCodeEvent( KeyCodeEvent.KEY_REPEAT, 
                                                    (char)Keypad.key(keycode),0 , 200));                          
                                    EventInjector.invokeEvent( new EventInjector.KeyCodeEvent( KeyCodeEvent.KEY_UP,
                                                        (char)Keypad.key(keycode), 0, 200));
                                    
                                        
                                    ApplicationHandler.setApplicationToForeground(appProcessID);  
                                    return true;
                            }
                            return super.keyRepeat(keycode, time);
                        }
                                
                };

Last edited by arunk : 06-25-2008 at 05:23 AM.
Offline  
Old 06-25-2008, 05:41 AM   #9 (permalink)
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question

In the above problem , if the alt key is pressed it will work ...

The edit filen has a filter for phone number so when I press "1" it will display "1" but the parameter key in keychar has a value "q"..

what can i do to solve this problem?
Offline  
Old 08-13-2008, 01:26 AM   #10 (permalink)
Talking BlackBerry Encyclopedia
 
arunk's Avatar
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 229
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

is it possible to invoke the speed dial screen from an application?
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.