CHT Android cannot login while offline


we have discovered that on Android we cannot login to CHT when the tablet is offline. We need to do this because several people might use the same tablet in an offline environment.

Is there something that could be changed during the building of the app so that all the necessary data is included and nothing is retrieved from the server upon login?

Hello @raf, the CHT is an offline-first app but it requires an internet connection to log in and to synchronize the data.
The device needs to be online for logging in to initiate a session and replicate the user’s data locally. For these reasons, a logged in user can use the CHT completely offline but they cannot switch to another user account while offline.
If they do not have an internet connection when switching users, I would recommend using one device per user.

@raf - while untested, you could in theory set up different Android profiles to run multiple instances of the app fully offline with different users logged in to each.

Use caution when doing this though: CHW A could easily think they’re using their profile but actually be in CHW B’s profile. The CHT doesn’t show label as to which user is logged in beyond looking in the hamburger menu.

Dear all, thank you for those hints.
@mrjones we will see if that is a viable proposition to have multiple Android accounts and run several sessions.

From a technical perspective it does not sound too difficult to have the database packed with the app if it is not too large. It would also allow to come to the field with an apk that is packed with everything and not need internet from the start.

Could you advice how much effort it would take to rewrite CHT and have a branch that allows that?

@mrjones this is unfortunately not working. I had to install the app for each user independently. When logged in with user 1 into the app and than changing the user profile at the device level, the app tries to reconnect as user 1 and tries to download the data from the web.

I have just found out that if the Android user decides to switch among applications, for instance when going from CHT to the app browser and then swipes CHT away, the application closes.

Then, in order to reuse CHT, one has to login for what Internet is required.
This is critical from my point of view because a field user could get stuck, when he has no internet.

The login is not cached.

I have just found out that this is only on one of our two flavors. On one, the login is cached, on the other not.