12-08-2009 08:03 AM
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?
Solved! Go to Solution.
12-09-2009 02:02 AM
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?
12-09-2009 04:41 AM
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?
12-09-2009 05:21 AM
thx for the reply.
"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..
12-09-2009 05:36 AM
for restart have a look at
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.
12-09-2009 05:45 AM
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?
12-09-2009 06:29 AM
Do you know of an app which do that?
12-09-2009 06:43 AM
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.
12-10-2009 01:19 AM
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!