Please tell me where you can find information on patterns & practices for implementing update applications from the Internet, including if the application for smartphones. At least how to call it and in what direction to look.
- I specify the task. There is an application running on smartphones (different platforms) and there is a server with data that changes every 2-3 hours. Data weighs from 20Kb to 4Mb. Code updates are done from the market. - Konstantin Ushenin
2 answers
When I needed to automatically update the application from the Internet, I wrote an additional program that hung in the background and was in fact the update manager, and she periodically asked the update server for updates, and as soon as they appeared, the program downloaded the update and waited for completion of the program, the update for which it downloaded, and as soon as the program was completed, the update manager replaced the files of this program with a newer version. Additionally, you could configure the update manager so that it shows the notification in the tray.
This method is very similar to the method used in the google chrome update system, but not so advanced :)
Another option is to start the application itself, to launch a separate thread in it, in which the search and installation of updates will be performed.
ps: // About software updates on smartphones, I don’t know about the rest, but the android updates the software automatically from google play, or issues a notification that updates have been found.
- onePerhaps the most common way =) The only thing that is not very good in him (IMHO) is that as soon as new programs are installed, over9000 managers appear in the system, and this slows down the system ... - allcreater
- If you deliver several programs, does it interfere with teaching your update manager how to update several different types of programs?) If you don’t want over9k managers, then start a separate thread in the context of your application and let it poll the update server. As soon as updates are found, it downloads updates, shows the user a notification. Suppose a user has clicked the "Refresh" button. Then we launch a newer version of the program downloaded and already unpacked into a temporary folder, with the command line arguments we indicate to it where we need to install the updates. - nolka
- After the updates are completed, the same program is launched again, but from the place where it was originally installed, and with the command line arguments we give it the path to the temporary folder that needs to be cleaned up after a successful update. Something like this:] - nolka
Self-updates are often platform-specific, so it’s worth looking for and reading about each specific environment.
For example Adobe Air has a native application self-update framework. Can be considered as one of the Best Practices.
Google on "application self update" or "auto update". For iPhone, for example, this is not possible. All updates - only through the AppStore or Cydia.