Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
estebanuri
Posts: 28
Registered: ‎11-04-2009
My Device: Not Specified

A way to put the phone on vibrate programatically

I want to make an application to put the phone on vibrate at certain hours. Is it possible? 

got stuck, because I can't modify sound profiles programmatically. 

Any ideas?

I tried to change the world, but I couldn't find the source code
Please use plain text.
Contributor
jiten_jk
Posts: 13
Registered: ‎09-16-2011
My Device: Black berry 9800/ Blackberry 6
My Carrier: BSNL/Airtel

Re: A way to put the phone on vibrate programatically

you can use net.rim.device.api.system.Alert,  startVibrate(int duration) , and stopVibrate().
         

Please use plain text.
Developer
titakalpesh
Posts: 203
Registered: ‎07-30-2009
My Device: Bold(9780),Curve(8520)
My Carrier: Vodafone

Re: A way to put the phone on vibrate programatically

I was tried the do same thing but not get any success so if any buddy have any idea please suggest the appropriate class and methods.

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: A way to put the phone on vibrate programatically

you can use http://www.blackberry.com/developers/docs/7.1.0api/net/rim/blackberry/api/profiles/Profiles.html, but only since 7.1
----------------------------------------------------------
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.
@SimonHain on twitter
Please use plain text.
Developer
titakalpesh
Posts: 203
Registered: ‎07-30-2009
My Device: Bold(9780),Curve(8520)
My Carrier: Vodafone

Re: A way to put the phone on vibrate programatically

Thanks simon,

 

But is there any other way to change the profiles in os version 4.6 to 7.0

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: A way to put the phone on vibrate programatically

no.

i think vibrate mode can be triggered by keycode injection though, by a long press of 'q' (or '#'?)
----------------------------------------------------------
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.
@SimonHain on twitter
Please use plain text.
Developer
titakalpesh
Posts: 203
Registered: ‎07-30-2009
My Device: Bold(9780),Curve(8520)
My Carrier: Vodafone

Re: A way to put the phone on vibrate programatically

Yes, we can do that on device directly let me check it but as of my experience some time key injection is not working properly with os 6.

Please use plain text.
New Developer
estebanuri
Posts: 28
Registered: ‎11-04-2009
My Device: Not Specified

Re: A way to put the phone on vibrate programatically

Very good news that finally we can manipulate the profiles!!!. :smileyhappy:
I'm now looking at the API of 7.1. So, in order to change the profile to vibrate-only I would have to get the desired Profile using Profiles.getDeviceProfiles(), and then use the method Profile.setActive ()?

 

I would like to implement it before 7.1, I've made some code that uses event injection to change the profile, but does not work if the keypad is locked.

I need to change the active sould profile from a application that runs on background, and in that case the keypad would be locked. Do you have any ideas to work around this issue using event injection before 7.1?

 

Br,

Esteban

I tried to change the world, but I couldn't find the source code
Please use plain text.