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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
CharlesMorse
Posts: 12
Registered: ‎08-29-2008

Programmatically rebooting the device

I was hoping to accomplish this by injecting the alt-shift-del key combination. 

After some research I came to know that it is not possible to inject such combination.

 

Is there any other way to reset the device programatically?

Please use plain text.
Developer
akirekadu
Posts: 52
Registered: ‎07-17-2008

Re: Programmatically rebooting the device

Have you looked at

 

Device.requestPowerOff( true )

 

Please use plain text.
New Developer
CharlesMorse
Posts: 12
Registered: ‎08-29-2008

Re: Programmatically rebooting the device

I can use that API as a last resort.

 

But I am really looking for a way to soft-reset the device.

 

Anybody?

Please use plain text.
Developer
peter_strange
Posts: 17,958
Registered: ‎07-14-2008

Re: Programmatically rebooting the device

I picked up the following code from someone on the Old forum, sorry don't remember who so can't give them credit. 

 

Not sure why I have commented out the request to POWER_ON.  I've not looked at the code in a year.  So this code, as supplied, might not work.  But I remember playing with it, and without much effort, I could get it to do a soft reset.  However this is NOT enough to install applications, so didn't do what I wanted.  But if all you want is a soft reset, then hopefully it will work for you.

 

public static final void powerCycle (int delayToPowerOn) { int timeDelay = 1000 * delayToPowerOn; ApplicationManager myMgr = ApplicationManager.getApplicationManager(); ApplicationDescriptor myDsc = ApplicationDescriptor.currentApplicationDescriptor(); // myMgr.setCurrentPowerOnBehavior(myDsc.POWER_ON); Date myDate = new Date(); myMgr.scheduleApplication(myDsc, myDate.getTime()+timeDelay, true); net.rim.device.api.system.Device.requestPowerOff( true); }

 

Please use plain text.
New Developer
CharlesMorse
Posts: 12
Registered: ‎08-29-2008

Re: Programmatically rebooting the device

Thanks very much for the code snippet.  Going to be very useful if I have to go with power recycle option.

 

I am still looking for a way to accomplish the equivalant of what happens when you press alt-shft-del  (ie soft reset)

Please use plain text.
Developer
akirekadu
Posts: 52
Registered: ‎07-17-2008

Re: Programmatically rebooting the device

^^ bump ^^

 

Is there a way to programmtically do the equivalant of pulling the battery?  I am looking for the kind of reboot that happens after reinstalling some apps.  Not the soft-reset (alt-caps-del).

 

 

Thanks in advance.

Please use plain text.
BlackBerry Development Advisor
ttahir
Posts: 36
Registered: ‎07-14-2008

Re: Programmatically rebooting the device

Use net.rim.device.api.system.CodeModuleManager.promptForResetIfRequired()
Please use plain text.
New Developer
jtwebfusion
Posts: 3
Registered: ‎12-04-2008

Re: Programmatically rebooting the device

Is there a programatic solution to execute a soft reset (alt+right shift + del)?
Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Carrier: ***

Re: Programmatically rebooting the device

Check the following classes to emulate soft reset key sequence:

 

net.rim.device.api.system.EventInjector
net.rim.device.api.system.EventInjector.KeyEvent

Please use plain text.
Administrator
MSohm
Posts: 13,066
Registered: ‎07-09-2008
My Carrier: Bell

Re: Programmatically rebooting the device

[ Edited ]
The EventInjector can not be used to inject 3 simultaneous key presses (Alt+Cap+Del).  You can do 2 (Alt+Del or Cap+Del), but not three.
Message Edited by MSohm on 12-12-2008 01:36 PM
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.