Android App - how to prevent saving usernames

Hello @dhis2-android team,

Is there a possibility to disable usernames and credentials being saved (upto 3 users) in the androi app.

After 3 users it’s inconvenient that we have to unnecessarily log in to any of the users to delete it so that we can log in as a 4th user.

Hi @jthomas,
At the moment we do not have a way to disable or restrict the maximun number of accounts.But we are thinking on how to improve the feature. You can check this issue which is related to the account system in the app and add any comment. :slight_smile:


Hello, @jthomas

On top of @Pablo 's comment I have created this: [ANDROAPP-5011] - Jira as I believe it might be a different use case.

Could you please add in a comment with your use case? It is not very clear what would you expect by disabling the usernames and credentials. Would you expect the App to keep the accounts but don’t display them? Would you expect the App to sync and disable the account when logging out?

As a workaround, please read carefully, remember that you can always go to the Android Settings > App > DHIS2 Android App > Storage and there delete the cache and the storage. By doing the later you will be deleting all the data in the phone about the App. This means that you will loose any not synced changes! All the accounts will be deleted immediately. But it can be useful in case you don’t have the account password at hand.


Thanks alot @Pablo and @jaime.bosque

I think i have one requirement exactly matching with ANDROAPP-4970 and another requirement shall be a comment on [ANDROAPP-5011] - Jira

Requirement 1: We shall be able to delete saved user credentials without logging in. In our project there are many users sharing the same device, for them it’s now a pain to login to somebody else’s account (since 3 people got saved) so that they can delete and login with their own credentials

Requirement 2: We also would like to have a flag in android settings, which will decide you want to save users credentials with this way or go back to v2.4 like logins


Hi @jthomas ,

Thanks for your input.
Regarding 1: I see your point, the problem is that this collides with the security model (or might do). As if your Acccount 1 has unsynced data, and a second user comes and deletes the Account 1, some data is lost without the approval of the owner. That’s the reason we are trying to come with a solution that could guarantee no data losses.

Regarding 2: The thing is this might not be a simple as you might be probably assuming that there is only one server. But this Account Manager should be agnostic to that because in case one server has the settings of “disallow account manager” but the second one you connect to has it enabled… what should happen? We are trying to come out with a fit-for-all solution (if that’s possible) so we are really analysing the problem and trying to come with a strategy. Please feel free to provide any further input on the ticket as specific field uses cases are very good input.



Thanks @jaime.bosque

1 Like