You can user SharedPreferences
to save the information, so the second time the user accesses your application, you verify that this information is populated and automatically log in.
Example to save the information using SharedPreferences
:
public static final String NOME_PREFERENCE = "INFORMACOES_LOGIN_AUTOMATICO";
SharedPreferences.Editor editor = getSharedPreferences(NOME_PREFERENCE, MODE_PRIVATE).edit();
editor.putString("login", "usuario01");
editor.putString("senha", "1234");
editor.commit();
And for you to recover this saved information:
SharedPreferences prefs = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE);
String login= prefs.getString("login", null);
String senha= prefs.getString("senha", null);
if (login!= null) {
// existe configuração salvar
} else {
// não existe configuração salvar
}