BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-24-2007, 11:16 PM   #1 (permalink)
Thumbs Must Hurt
 
Rose's Avatar
 
Join Date: Nov 2006
Location: India
Model: 9700
OS: Windows 7
Carrier: Airtel
Posts: 121
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Regarding Volume Keys

Please Login to Remove!

Hi,
Can anybody clarify me on using the RIM device side volume keys.. Is it possible to use the side volume keys programatically or not..

If it is possible how to do it ..(Any suggetions ?)Because those keys are not generating any key codes..

If it is not possible then how some third party applications provide use of it while some other complaints about RIM blocking the key access.

What is the original fact about the problem..
Offline  
Old 08-26-2007, 12:04 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Location: Bangladesh
Model: 8800
PIN: N/A
Carrier: EDGE
Posts: 93
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Rose,

You can use javax.microedition.media.control.VolumeControl.

public int getLevel() Get the current volume level set. getLevel may return -1 if and only if the Player is in the REALIZED state (the audio device has not been initialized) and setLevel has not yet been called.

public int setLevel(int level) Set the volume using a linear point scale with values between 0 and 100.

Characters.CONTROL_VOLUME_UP
Characters.CONTROL_VOLUME_DOWN

- Generate when you press volume controls.

Cheers,
ARIF
Offline  
Old 08-27-2007, 04:47 AM   #3 (permalink)
Thumbs Must Hurt
 
Rose's Avatar
 
Join Date: Nov 2006
Location: India
Model: 9700
OS: Windows 7
Carrier: Airtel
Posts: 121
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Arif,
Im not in need of a method to reduce and increase the volume. I wanna call those methods on the key press.. of the side volume keys.
So that when user presses the side volume keys in pearl top key should increase the volume as in native media Player and bottom key should reduce the volume.
And im just in need of those two keys only (Any ideas..)
Offline  
Old 08-27-2007, 05:00 AM   #4 (permalink)
Thumbs Must Hurt
 
Rose's Avatar
 
Join Date: Nov 2006
Location: India
Model: 9700
OS: Windows 7
Carrier: Airtel
Posts: 121
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Ariz,
Characters.CONTROL_VOLUME_UP
Characters.CONTROL_VOLUME_DOWN

- Generate when you press volume controls.

AS you stated these keys are not get called while i press volume controls..

Have you tried it if so is it working for u ?
Offline  
Old 08-27-2007, 07:12 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Location: Bangladesh
Model: 8800
PIN: N/A
Carrier: EDGE
Posts: 93
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Rose,

Quote:
Originally Posted by Rose View Post
Characters.CONTROL_VOLUME_UP
Characters.CONTROL_VOLUME_DOWN

- Generate when you press volume controls.

AS you stated these keys are not get called while i press volume controls..

Have you tried it if so is it working for u ?
I didn't try it myself. VolumeControl Interface doesn't work on simulator But it should work on device.

Cheers,
ARIF
Offline  
Old 08-27-2007, 09:23 AM   #6 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

just capture the presses using keyControl rather than keyChar:

Code:
public boolean keyControl(char c, int status, int time){
        switch(c){
            case Characters.CONTROL_VOLUME_UP:
                //up action
                return true;
            case Characters.CONTROL_VOLUME_DOWN:
                //down action
                return true;
        }
        return false;
}
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 08-27-2007, 11:32 PM   #7 (permalink)
Thumbs Must Hurt
 
Rose's Avatar
 
Join Date: Nov 2006
Location: India
Model: 9700
OS: Windows 7
Carrier: Airtel
Posts: 121
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks JFisher,
This one works pretty ... Thanx for your valuable suggestions..
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





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