Getting Android App Version from App

Getting Android App Version from App

  

Good morning,

I need to be able to compare the currently installed app version and the one that is most recent, without installing plug-ins.

I need this so when I import new dependencies or whatever, I generate a new APK and the app detects it and prompts me in the app to download the newest APK.


Thank you for the attention!

Hi Diego


In the System dependencies, you have a table called Espace and one called Espace_Version. From this tables you can get the latest published build on Service Center by doing something like:

  1. Aggregate containing Espace and Espace_Version joind by Espace.VersionId = Espace_Version.Id
  2. Filter by Espace.Name = "YourEspaceName"
  3. Espace_Version.Version will be the latest published.


You'd have to store this value in a local table on the when you generate the APK, and update and compare this value the next time you need to generate an APK

Note that this gives you a version for each publish, not for each app generation, the same as if you were to go to your eSpace Details and see the value 'Version'.


I do not know if you can get a generation version, but I would look for it on the Lifetime API or Lifetime SDK.


Hope this helps!

  -CLSJ