Demonstrates implementation of in-app updating of Play Store apps on Android. As such, this demo really only applies to Android.
The code/demo was built for Delphi 11, however it might be able to be modified to work in Delphi 10.4.2
Please refer to the demo as a guide on how to use TAppUpdate
.
CheckForUpdate
is an asynchronous call to check if an update is available, and returns the info in theOnAppUpdateInfo
eventStartUpdate
is an asynchronous call to start the update flow for the specified type. TheOnAppUpdateStartedFlow
event is called with theStarted
parameter indicating whether or not the flow did actually start. TheOnAppUpdateResult
event is called when the flow finishes, and theUpdateResult
parameter indicates whether or not the update succeeded, or the user canceled.
These are instructions for configuring your own project to use the App Update feature
This feature is dependent on the Play Core library, which does not ship with Delphi. Add the play-core-1.10.0.jar
library to the Libraries node, under the Android target in Project Manager.
Please refer to the Build Events section of the Project Options. There are two commands in a Post-Build event:
- Merge
AndroidManifest.template.xml
using themanifestmerge
tool in the Tools folder of Kastri - If Delphi generates a
styles.xml
file (as it does when you enable the splash screen), the fileResources\styles.merge.xml
is merged (usingresmerge
in the Tools folder) with the Delphi generated file into theResources\Overrides\res\values
folder. This file is included in the Deployment (see Deployment section below)
You may need to modify these commands to suit your environment.
As per the Build Events section above, the merged styles.xml
is added to the deployment. As this file is an "override", the Delphi generated styles.xml deployment needs to be disabled (if one exists):
Thanks to Igor Costa who helped with testing and provided valuable feedback