How to retrieve the apk version number

Penfound

Active Member
Licensed User
Longtime User
I want to be able to display the version number of the installed app on my main page. Is there a simple way to achieve this? Please.

Penfound:sign0085:
 

mc73

Well-Known Member
Licensed User
Longtime User
Some days ago, I found this somewhere in this forum:
B4X:
Dim pm As PackageManager 
currentVersion=pm.GetVersionCode ("your app's name here")
It worked for me, it gives the integer number of version. If you want the stringCode, I think you could try pm.getVersionName .
You have to include the Phone library for this (I suppose)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…