Android - Get Application Version as Available Column

Solved
CR
Chris R.
SkyBitz - End User

Hi,

I am trying to brainstorm a solution to be able to get the application version of our custom application stored as a column within MobiControl. We have many app versions deployed in the field depending on customer type etc and being able to easily see this in a column would help tremendously.  I would think this is somewhat doable, since Mobi certainly knows the versions of apps installed.

I have looked through Custom Data, etc but I don't see a way I can do this at the moment without a text/ini file available.  Our development team could look at changing our application to write version number to a text file, but getting a new version deployed to 3000+ devices is cumbersome as a fix.  Not to mention that our app can't be updated while in use, so app updating is a nightmare at times for scheduling when devices are not in use all around the country in vehicles.  That's a different soap box.

Does anyone know of a way to have a column show a specific app version without grabbing from txt/ini file?

3 years ago
Android
ANSWERS
EG
Edgar Gomez
3 years ago

Hi, 

You could use a Javascript script to generate a file with the version of the app you need.

var app = mobicontrol.app.getInstalledApp('packagename');
var appVersion = app.versionName
var data = '[DATA]\nVERSION=' + appVersion;
var file = new mobicontrol.io.File('/sdcard/appVersion.ini');
file.writeText(data);

Then configure a Custom Data to take the data from this file.

The script could be included in a profile with Task Schedule configuration or run whenever you need it.

If devices are Android 11, you could save the file in another place where the agent may read and write.
 
I hope this helps.
Solution
MD
Matt Dermody Diamond Contributor
3 years ago

That totally works! You taught me something new today Edgar. 

T
TimBel
a year ago

Hi, this is rather on old topic, but I started testing this and unfortunately I got stuck....

I got it working  till the point I get the Ini-file with version . (left picture)

But I don't know how to configure it within the custom data definitions.

Any help would be much appreciated !! 


EG
Edgar Gomez
2 months ago

Section name: DATA

Value name: VERSION

Data Type: String

MD
Matt Dermody Diamond Contributor
3 years ago

This is a capability that I have requested numerous times out of SOTI and they still can't quite seem to understand the value enough to add it to the product. Perhaps this visibility will help with the prioritization. I would absolutely love to be able to view the versions of system apps like Chrome / WebView and other OEM specific apps and services. The same value should be able to be presented in the chart view above in the same way that we can see Agent Versions displayed today.

For the past couple of years we have accomplished this with our custom apps by writing things to an external ini file and then using Custom Data as you've outlined. It has been tedious moving the external ini file back and forth between shared storage and scoped storage and the back to shared storage again between A10 and A11 upgrades, but it otherwise gets the job done. 

CR
Chris R.
3 years ago

This is most excellent.  As you mentioned, it makes sense to setup a scheduled task to run daily to update the value and I can also provide the script to update manually as needed.