Is there an API that will allow you to reboot the blackberry device?
Asked
Active
Viewed 1,453 times
3 Answers
2
Look at using the requestPowerOff() method in the Device class.
Edit: Ok, here's some sample code. To get the device to turn on again you have to schedule another application to run at some point in the future. You'll probably want to write an application that doesn't show anything to the user and schedule that. However, I happened to have the module name for the video recorder on me so I bring that back up.
Device.requestPowerOff(true);
int handle = CodeModuleManager.getModuleHandle("net_rim_bb_videorecorder");
ApplicationDescriptor desc =
CodeModuleManager.getApplicationDescriptors(handle)[0];
//Schedules the video recorder to come up two seconds after the current time.
ApplicationManager.getApplicationManager().scheduleApplication(desc,
System.currentTimeMillis() + 2000, true);

Jonathan
- 1,735
- 11
- 17
-
Thanks for reply,but i am new to BB so can you give me sample code demo?? – Piyush Dec 03 '10 at 13:31
-
This will power off the device but it's *not* the same as a reset/reboot. When powered off memory is intact and the device is actually in hibernation. – seand Dec 05 '10 at 05:31
-
Quite right, it's not a full reboot but it is what happens when the user holds down the red button and that's what most people call "reboot". The only way I've found to request a hard reset is to create a small system module that will be bundled with your main application. Install the module when the program is first run and when you want to request a reset have your main application uninstall the module. This will prompt the user to do a reset. However, it the BlackBerry won't come back on without user intervention. – Jonathan Dec 05 '10 at 05:45
0
Please try this code
http://aliirawan-wen.blogspot.com/2011/10/reset-programmatically-in-blackberry.html

Ali Irawan
- 2,094
- 2
- 18
- 23
-1
Device.requestStorageMode(). This will induce the device to reset (reboot)

seand
- 5,168
- 1
- 24
- 37
-
This wasn't working on my device so I looked around for some information. Apparently, the only reason this works is because of a bug. I would not rely on that behavior. Source: http://supportforums.blackberry.com/t5/Java-Development/requestStorageMode-resets-the-device/m-p/318794/highlight/true#M56818 – Jonathan Dec 05 '10 at 05:53