I am writing an application with login details (username and password).
I want to make it so that when the user closes the application and starts it again later he/she d
I high not recommend your logic ! I recommend you toAccountManager API to authenticate and store the users credentials, or write your own account manager, always use this AccountManager which only stores your auth-token.
Account Manager's data can also be accessed through a root!
For your logic at least try to to use SharedPreferences in secured way otherwise with root access we can get SharedPreferences data from the mobile!