Hi
excellent program, for me the best.
But with my nokia 5130c-2 Calc loses the settings and programs written (sob), and start again from 0.
Any suggestions or is the phone faulty?
Thanks
Ciao
Maurizio
Hi Roar
thanks for your prompt answer.
The strange thing is that for a period (about 6 month) has worked well with the hang up button.
Now I use only the sequence "mode/sys/exit".
Maybe this can help you to debug the program.
Thanks for the wonderful program.
Ciao
Maurizio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Now, my comment about this problem. If you want to keep the app portable and not have a different version for every phone... do not try to "trap" the "hang up" button. Don't write RMS, don't do any calculations, don't do anything... exit as soon as possible because the application management system can pull the rug out at any time. There are NO guarantees. Different vendors, handsets etc will vary - some phones will give a 'grace' period of a few tenths of a second, some give a 'grace' period of more... but there are absolutely no guarantees.
If you are familiar with Unix signals, think of the the 'hang up" button as kind of like SIGKILL - "When sent to a program, SIGKILL causes it to terminate immediately ... this signal cannot be caught or ignored, and the receiving process cannot perform any clean-up upon receiving this signal." -Wikipedia
Unfortunately, the J2ME specification for destroyApp is not as nice/clear as the POSIX specification for SIGKILL. The safest thing to do (for portability) is just adhere to a POSIX-like interpretation. Again, this is if you want to "write once, run everywhere". Some people are happy having a different version for every handset - but that's typically not feasible.
That said, the only *portable* way to exit safely (as you suggest) is using your 'mode/sys/exit' menu. So, my recommendation would be to perform the RMS writes *only* when the user exits via the menu, not when Midlet.destroyApp is called by the platform (i.e. hangup button). The only other real alternative is to rely on vendor specific mumbo jumbo like jad settings (e.g. Nokia-MIDlet-No-Exit)... turns out to be uglier (IMHO).
Also, you might consider writing something to RMS to indicate the app was closed via 'mode/sys/exit'. This way on start-up you can check for a clean exit and warn the user that they should avoid the hang up button if they want to make sure everything is saved. You know what I mean? I've done this sort of thing myself in some apps (e.g. http://www.getjar.com/mobile/26079/wrath-of-achilles/\) and it has worked well for me.
Finally, make sure to test on at least a few different phones from different manufacturers... but it seems like you do this already.
I think if you take this approach you'll have happier (and less confused) customers.
Anyway, definitely an awesome Midlet - keep up the good work!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Some nokia's don't save if you just press the "hang up" button to exit. Have you tried exiting with "mode/sys/exit"?
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Hi Roar
thanks for your prompt answer.
The strange thing is that for a period (about 6 month) has worked well with the hang up button.
Now I use only the sequence "mode/sys/exit".
Maybe this can help you to debug the program.
Thanks for the wonderful program.
Ciao
Maurizio
First, Roar... awesome app dude, I love it!!!
Now, my comment about this problem. If you want to keep the app portable and not have a different version for every phone... do not try to "trap" the "hang up" button. Don't write RMS, don't do any calculations, don't do anything... exit as soon as possible because the application management system can pull the rug out at any time. There are NO guarantees. Different vendors, handsets etc will vary - some phones will give a 'grace' period of a few tenths of a second, some give a 'grace' period of more... but there are absolutely no guarantees.
If you are familiar with Unix signals, think of the the 'hang up" button as kind of like SIGKILL - "When sent to a program, SIGKILL causes it to terminate immediately ... this signal cannot be caught or ignored, and the receiving process cannot perform any clean-up upon receiving this signal." -Wikipedia
Unfortunately, the J2ME specification for destroyApp is not as nice/clear as the POSIX specification for SIGKILL. The safest thing to do (for portability) is just adhere to a POSIX-like interpretation. Again, this is if you want to "write once, run everywhere". Some people are happy having a different version for every handset - but that's typically not feasible.
That said, the only *portable* way to exit safely (as you suggest) is using your 'mode/sys/exit' menu. So, my recommendation would be to perform the RMS writes *only* when the user exits via the menu, not when Midlet.destroyApp is called by the platform (i.e. hangup button). The only other real alternative is to rely on vendor specific mumbo jumbo like jad settings (e.g. Nokia-MIDlet-No-Exit)... turns out to be uglier (IMHO).
Also, you might consider writing something to RMS to indicate the app was closed via 'mode/sys/exit'. This way on start-up you can check for a clean exit and warn the user that they should avoid the hang up button if they want to make sure everything is saved. You know what I mean? I've done this sort of thing myself in some apps (e.g. http://www.getjar.com/mobile/26079/wrath-of-achilles/\) and it has worked well for me.
Finally, make sure to test on at least a few different phones from different manufacturers... but it seems like you do this already.
I think if you take this approach you'll have happier (and less confused) customers.
Anyway, definitely an awesome Midlet - keep up the good work!