There are many many ways of doing this,
michaelleewebb. As always, it depends on your app and what/if it connects to anything else.
The way one of our larger, distributed B4J apps does it is like this ...
- StarterApp is what the user 'runs' first. It's what they think is the main app. This app downloads resource files, any updates, gives a splash screen, terms of service, and generally gets things ready and starts the MainApp. We used to call this the "kickstarter" decades ago.
- MainApp checks for a file on a webserver on a timer.
- MainApp sees that there's an update. It notifies user.
- User stops MainApp whenever they want.
- User starts it back up again (StarterApp ... see above) and the StarterApp does the old switcheroo of swapping the old MainApp with the new MainApp and starts the MainApp.
For a Client/Server app (both B4J) of ours that is a SAAS product using a constant websocket connection , it's a little cleaner because when the MainApp connects to the ServerApp backend, it transmits its' version. The ServerApp then does the checking of each clients' version and requirements against the 'current' version and then notifies the MainApp when an update is ready. The MainApp, again, waits for the user to accept the update (although sometimes it's a critical update and forces them to finish what they're doing and won't let them continue ... your requirements may vary) then downloads the new version of MainApp for them and the StarterApp does the same as above.
And, yes, Erel, it CAN BE very much worth the effort. Lots of different requirements out there in the world