Closed GoogleCodeExporter closed 9 years ago
When the checkUpdateTask asks for an update, it sends the MD5 sum of the last
received update (or the current running file, if there were no updates yet). If
the MD5 sum received from the application and the MD5 sum of the newest version
on the server match, "no update" reply is sent back, preventing from
downloading same files again and again.
This however works only if you keep the default setting for "Deploy update
when:" as "MD5 has changed".
Original comment by lenik.terenin
on 3 Oct 2012 at 7:31
I see that the MD5_KEY is updated with the downloaded file path in
checkUpdateTask.onPostExecute(). Also, as it is initialised to the MD5
checksum of the ApplicationInfo.sourceDir
http://developer.android.com/reference/android/content/pm/ApplicationInfo.html#p
ublicSourceDir of this package.
So if I understand the behaviour correctly: the first update will download the
file, and populate the UPDATE_FILE string in the SharedPreferences. Then the
next time an update is checked, the new downloaded MD5 check sum will be
submitted, and the server will respond with "no update".
I have an activity that is listening for an update from AutoUpdateApk, so that
it can pop up a box to inform the user (our users need a louder indication than
something in the notification bar). After the first update signal,
AUTOUPDATE_GOT_UPDATE, each subsequent check for update will send to its
observers AUTOUPDATE_NO_UPDATE (as the MD5 checksums should match).
So in the scenario where an update is available, but not enforced, the pop up
will never be shown again.
Shouldn't there be another notification state? Say AUTOUPDATE_UPDATE_DOWNLOADED?
Original comment by diederik...@gmail.com
on 3 Oct 2012 at 11:08
Totally agree with you, thank you for your comment!
From now on (v1.7) we have two different notifications regarding updates:
AUTOUPDATE_GOT_UPDATE -- we have just received an update from the server
AUTOUPDATE_HAVE_UPDATE -- there's an update available for installation
When the update has just arrived, both notifications are sent. When user has
restarted an application and there's already downloaded file, only the
HAVE_UPDATE notification is sent to the Observer.
Original comment by lenik.terenin
on 4 Oct 2012 at 8:17
Original issue reported on code.google.com by
diederik...@gmail.com
on 3 Oct 2012 at 6:55