I am developing an Android application with C++ Builder. I need to get the application version but I don't know how to do it. I already did it with a Windows application but with Android it's FMX and not VCL. Someone know how to do it?
Asked
Active
Viewed 108 times
0
-
1Perhaps http://stackoverflow.com/questions/22315571/android-application-version-rad-studio-xe5 – Kerem Jul 19 '16 at 15:10
-
@KeremD I already tried that in C++: `JPackageManager* PackageManager = Androidapi::Helpers::SharedActivityContext()->getPackageManager(); _di_JPackageInfo PackageInfo = PackageManager->getPackageInfo(SharedActivityContext()->getPackageName(), TJPackageManager::JavaClass->GET_ACTIVITIES); return Application->Title + " " + JStringToString(PackageInfo->versionName);` but I have a segmention fault at the 2nd instruction – Dylan Jul 20 '16 at 06:19
-
`PackageManager` has to be of type `_di_JPackageManager` and not `JPackageManager*` – Kerem Jul 20 '16 at 06:57
-
Thanks! It works now! Sorry for the duplicate question. – Dylan Jul 20 '16 at 07:09