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
Developer
Posts: 745
Registered: ‎01-04-2009
My Device: 8300, 8800, 8700f, 9000
Accepted Solution

restart of the device

hi, i've got two questions about device's restart:

 

1. how can i programatically restart the device?

2. after installation of my app can i show somehow a message that 'You should restart the device' or force the device to restart itself?

 

 

regards

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: restart of the device

This topic has been covered at length, on a number of Threads on this forum.  Please search for other Threads, and let us know if you don't find anything that helps you.

Developer
Posts: 745
Registered: ‎01-04-2009
My Device: 8300, 8800, 8700f, 9000

Re: restart of the device

hi,

 

only my first question was talked on this forum and i did a search before. there are lots of threads but none of it gives a clear answer.
it is mostly said that 'rather not', but.. i see that in CodeModuleManager class is a method 'promptForResetIfRequired' so it is possible at least to ask for reset.. so maybe it is also possible to force it?


about my second question i did not find anything.. after OTA installation, how to force device to ask for restart? actually i do not understand why it does not ask-cause my application is a background application which starts after device restart so it should ask..

can anyone help me with these two problems?

 regars

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: restart of the device

Just for clarification, I have interpreted your second question as follows:

"Can I invoke some processing (such as display a message) immediately after an OTA install"

 

After any installation, the auto-start processing will be performed.  So you can detect this and action appropriately.  For example you could have a persistent flag that indicated if a reset had been done.  Check this flag is not set and the start up processing is being invoked and it is not ApplicationManager.inStartUp, then you need to display a message.  Next time through, you can be sure the device has been restarted. 

 

I do think your question about resetting the device has been covered in full elsewhere, including the answers to your  questions about 'promptForResetIfRequired'.

 

The clear answer is that there is no API to force the restart of the device. 

 

There are a number of programs that will do it.  I suspect they do this, by including a second cod (which is auto-started) within their application cod, installing that second cod on the device and then removing it, which will force a restart.  Perhaps you could consider doing something like this?

Developer
Posts: 745
Registered: ‎01-04-2009
My Device: 8300, 8800, 8700f, 9000

Re: restart of the device

thx for the reply.
but..


"After any installation, the auto-start processing will be performed. So you can detect this and action appropriately.  
For example you could have a persistent flag that indicated if a reset had been done. Check this flag is not set and the start up processing is being invoked and it is not ApplicationManager.inStartUp, then you need to display a message. Next time through, you can be sure the device has been restarted. "

i think You do not understand me clearly. My app is: background app and it is set to 'auto-start when device restart'. what happens is:
i install this app OTA. after installation nothing happes (only a message that app was installed successfully). app won't start! (cause it auto starts when device restart..). the problem is that user won't know that it must be restarted cause any message is shown! "persistent flag that indicated if a reset had been done" - how and what for? after OTA installation nothing happens so how can i set any flag? the only way to do this is another app?!

the thing about restarting the device when removing another cod may be worth considering. at least it is some option..

Developer
Posts: 190
Registered: ‎10-22-2009
My Device: Blackberry Torch

Re: restart of the device

for restart have a look at

http://supportforums.blackberry.com/t5/Java-Development/API-for-rebot-reset/m-p/392676

 

for your second problem I think you can let user config your app first  time before running app in background

and then reboot during that.

-----------------------------------------------------------------------------------
Please mark posts as solved if you found a solution. Press the kudos button to thank the user who helped you.
Developer
Posts: 745
Registered: ‎01-04-2009
My Device: 8300, 8800, 8700f, 9000

Re: restart of the device

no i cannot let user set any settings! (this is an assumption of the app).

 

i do not understand why device won't force a message about restarting itself!

 

does anyone has any other idea? what can be done with that?

 

regards

Developer
Posts: 190
Registered: ‎10-22-2009
My Device: Blackberry Torch

Re: restart of the device

 

Do you know of an app which do that?

-----------------------------------------------------------------------------------
Please mark posts as solved if you found a solution. Press the kudos button to thank the user who helped you.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: restart of the device

Sorry to repeat myself, but the autostart processing is run after an OTA installation and can be used to detect the first install.  It is also run on device startup.  This should be able to do what you require regarding requesting a restart of the device, and in fact you should be able to detect that the device has been restarted.

Developer
Posts: 745
Registered: ‎01-04-2009
My Device: 8300, 8800, 8700f, 9000

Re: restart of the device

1.sorry, but i just do not understand You (probably because of my english which is not too good).

ok, i install my app OTA. but after that-what? You have written that "autostart processing is run after an OTA installation and can be used to detect the first install". how?? do i need another app to detect that? i really do not understand ://

 

2.actually there is another thing i do not understand. some background apps start after installation and some needs the device to be restarted. i've noticed that simply apps start just after installation and bigger and more advanced apps don't! why?? if they are both background apps which start run on device restart, then both should need a restart!