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
webster354
Posts: 7
Registered: ‎05-17-2009
My Device: Not Specified

Prevent BlackBerry From Going Into Sleep Mode

I'm creating a Bluetooth application using the (Java JSR-82) with the objective of constantly send/receive data with another Bluetooth device.  Currently with my application if the BlackBerry is left unattended the screen goes black and I assume goes into sleep mode.  The problem with this is that it does not allow me to send/receive Bluetooth data to my other device anymore.

 

Is there a way to prevent the BlackBerry from going into sleep mode?  I've read elsewhere that I could use the BB API to keep the screen on, but that requires a signed application.  Does anyone have any solutions for me? Thanks!

Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Prevent BlackBerry From Going Into Sleep Mode

I did not hear about such API to prevent going to sleep mode.

 

But I think there is a workaround.

 

Try to send keyboard events to the device via EventInjector class.

 

Your application will send these events and consume them.

 

I think it should work, like a user clicks on keyboard from time to time.

 

what do you think ?

 

try this.

Please use plain text.
New Developer
webster354
Posts: 7
Registered: ‎05-17-2009
My Device: Not Specified

Re: Prevent BlackBerry From Going Into Sleep Mode

Seems like that would work, but The EventInjector requires the application to be signed, I'm looking for a solution that does not require this.  So far I'm not sure if this is going to be possible.  Thanks for your suggestion though.
Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Prevent BlackBerry From Going Into Sleep Mode

[ Edited ]

Signing keys cost just 20 USD for unlimited signatures for unlimited qty of applications.

 

In case you intend to make an application that is a bit more complex than helloworld you will need to use classes which use signed API and will need to sign the cod file.


Message Edited by tbilisoft on 17-05-2009 09:11 PM
Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Prevent BlackBerry From Going Into Sleep Mode

Check the link below:

 

Signing keys

Please use plain text.
Developer
pwerry
Posts: 177
Registered: ‎01-21-2009
My Device: 9900
My Carrier: Vodafone

Re: Prevent BlackBerry From Going Into Sleep Mode

After signing you will also have the challenge of requesting that the user set the event injector permissions to allow. By default on many distributions this is set to deny. Not really a huge deal, but "Input Simulation" is a scary term for users. 
Please use plain text.
New Developer
webster354
Posts: 7
Registered: ‎05-17-2009
My Device: Not Specified

Re: Prevent BlackBerry From Going Into Sleep Mode

Thanks for your input.  I'll leave this thread open if anyone can come up with any other solutions.

BTW I submitted the form for the code signing key.

Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Prevent BlackBerry From Going Into Sleep Mode

RIM takes several days to consider your form for signing keys.

 

After that you will receive email with signing keys and instruction how to install them.

 

Keep the received files in secure place.

 

 

 

 

 

Please use plain text.
New Developer
webster354
Posts: 7
Registered: ‎05-17-2009
My Device: Not Specified

Re: Prevent BlackBerry From Going Into Sleep Mode

Another thing to add, do you think it is possible to turn the screen off and still prevent it from going to sleep.  I need a solution to maximize the battery life.
Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Prevent BlackBerry From Going Into Sleep Mode

Never checked this.

 

Try to check the class: net.rim.device.api.system.Backlight

 

there are methods to enable/disable device backlight.

 

try to turn off backlight and send a keyboard event. 

Please use plain text.