Reboot After OTAP (was OTAP problems)

41 views
Skip to first unread message

Gabriel Duarte

unread,
Feb 20, 2014, 10:06:32 AM2/20/14
to javacint
Hello again,

I have implemented an OTAP class to handle app updates into my TC65i, but I noticed that after OTAP, JVM stops and doesn't restart the program neither the modem.

This way, when the OTAP is finished, the app stops and I have to start it manually. I set Autostart to 1, but it does not have any affect. Any suggestion/advice?

Thanks in advance,
--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/

Nikita Kapitonov

unread,
Feb 20, 2014, 12:00:49 PM2/20/14
to java...@googlegroups.com
Gabriel,
OTAP must set up the "userware/autostart/appname" to the .jar name of your new application, then it reboots in any case (successful or not).

If your device start the program automatically after power-up, then no problem should be with OTAP.

Make sure your class don't reboot the device by itself, because OTAP procedure should be able to close the java program by calling destroyApp() method and then reboot the device into OTAP mode. destroyApp() also should not reboot device by itself, in other case OTAP will not continue.



--
javacint group - http://www.javacint.com/
---
You received this message because you are subscribed to the Google Groups "Cinterion Java enabled chips support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javacint+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Drec

unread,
Feb 20, 2014, 1:19:21 PM2/20/14
to java...@googlegroups.com, nikita.k...@teplomonitor.ru
I do agree with you Nikita. The MIDlet has to end properly by calling the destroyApp() method.
This is why I am thinking to something that may occur in some case. Indeed it appears that the program cannot 'be closed' entirely due to some reasons:

- ensure that all threads are actually closed before calling destroyApp()
- check if your program doesn't stick in an endless loop

Advice from the “Java User Guide” document:
================================
- Take care that the startApp() method is always properly terminated before calling the destroyApp() method, for example avoid that threads launched by startApp() enter a closed loop, and be sure that all code was entirely executed. This is especially important for OTAP, which needs to call destroyApp().
As a consequence we must clean up everything not handled by the garbage collector.
At least we stop the threads, and finally the MIDlet has been terminated properly and is ready for reclamation by the garbage collector.

Regarding the notice above MIDlet leaves the startApp() by stopping by its own. I do remember that Florent has explained this very well. What he suggest is calling a method (launched by startApp()). You can call it core() for instance.

Another thing you may take into consideration:
When the “destroyApp” method is called by the system, we have 5 seconds to close everything and call notifyDestroyed. If it lasts more than 5'' the program will quit and it will display a warning on the console.

In conclusion, ending a MIDlet is sometime tricky...

- Frederic -

Reply all
Reply to author
Forward
0 new messages