I tried to use and configure the web application “APK Distribution” to make sure all our users can only use the Android Capture 3.1.0, and block users trying to connect with older or newer versions.
I managed to upload a version of the apk but I am not clear about the process to activate the check to compare the user version and the available version on the server.
To me, this only works when the Android user looks for updates from his mobile application, but the users can still connect and submit data using older or newer version than the one uploaded on the server.
The documentation mentions “Admins will be able to upload the desired version and users will get a prompt message to update when they are not in the last updated version.”.
How are users supposed to get this prompt message? Shall they visit manually the web application url (DHISURL/api/apps/apk-distribution/index.html)?
Is there any additional documentation about this web application available?
Hi @Gassim
Thanks for the feedback. I do confirm I assigned user groups to the APK and my user is indeed in one of the user groups assigned to the version (although he also belongs to other user groups not listed in the apk distribution settings).
My only doubt regarding the configuration is that I did not upload the apk version directly on the server, but I just inserted the url from github android releases. However, when I visit the web app page, and click the download button, the download is working well.
We are currently using the following versions on this testing instance:
the android app periodically checks for updates in the server. If you upload a new apk and assign a higher version (in the box pointed in the picture), the android app will download the new apk from the url specified and will ask the user to install it.
The important process is the distribution of the initial apk. If the users download the apk from Google Play or the version is higher to the one specified in the Apk distribution, the Android app will ignore the settings in the Apk distribution app because it is not possible to downgrade the version. A recommended way to distribute the initial apk is to ask the user to enter the Apk distribution app and click on the download button (explained here)
I am not sure I answered your question, please let me know.
We were already using APKs downloaded from github.
I just tried to upload first the version 3.0.1 to the APK disttribution APP, and shared it with one of the group my user belongs to.
I then visited the APK ditribution web page from my android device, and downloaded the version 3.0.1. I installed it and connected to DHIS2, and synced configuration and data.
Then, I uploaded the version 3.1.0 to the APK distribution App, and shared it with the same user group.
Unfortunately, when I connect again using 3.0.1, I can still access the data and sync, but there are no messages saying there is an available version.
Even when I do settings → Software Update check for updates, there is no update available.
I use the standard Android Capture APK (not google and not training).
I can’t understand what I am doing wrong sadly.
I even tried to remove the user groups with same result: there are no messages saying that version 3.1.0 is available when connecting with version 3.0.1
I am afraid there is a bug in the Android app when comparing the version number. The Android app does not consider 3.1.0 as greater than 3.0.1, and that is why it is not triggering the update.
If this is very urgent I can suggest a few workarounds. They are not ideal but I can’t think of a better alternative at the moment. The bug will be fixed in the next patch release anyway.
Option 1:
Write version 3.1.1 instead of 3.1.0 (even if the apk corresponds to 3.1.0). This version is considered greater than 3.0.1 and it will trigger the update.
Option 2:
The version 3.1 is considered greater than 3.0.1, but the APK distribution app prevents writing a two-digit version.
So, you will have to enter 3.1.0 in the first place (as you did), then go to the DataStore Management app and change the value from 3.1.0 to 3.1. You will have to change it in the “APK_DISTRIBUTION” namespace, in both “latestVersion” and “versions” spaces.
Option 1 does the trick but i am afraid to introduce confusion for the future when we will deploy the real version 3.1.1.
Option 2 also works fine, but after changing the version number in the datastore, i can not add user groups for this version. However, if i change back the version in the data store, add the user group and change again, the user groups keep staying.
This will however be sufficiuent for the moment, but jiust wanted to share this info with other users reading this post.
Many thanks foir this trick Victor.
I have on last question about triggering the notificatio about a new version:
For now, it seems I need to go to “Settings > Check for updates” from the older android app to trigger the notifcation about ther new version being available.
Isn’t this notification supposed to show up automatically without the need to manually check for updates?
Or shall we ask our users to check for updates after adding a new version?
The notification will be prompt only when the user is doing the first login. If the user is already logged in, you’ll need to ask them to go to the settings menu and check for updates.
We do have in mind that it will be useful to have notifications and hope to have an improvement for future versions.