如何保存的Andr​​oid应用程序登录信息? [英] how to save login details of android app?

查看:107
本文介绍了如何保存的Andr​​oid应用程序登录信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有需要的用户名和密码登录一个Android应用程序。我需要在本地保存的用户名和密码在手机或其他地方使用它们,当用户将自动打开的应用程序,接下来的时间,登录到应用程序,而不显示登录屏幕

I have a android application which needs username and password to login. I need to save the username and password locally in phone or somewhere to use them when the user opens the app next time and logins to the app automatically without showing the login screen

    EditText input1 = (EditText) findViewById(R.id.usertext);
    EditText input2 = (EditText) findViewById(R.id.Passtext);
    String username = input1.getText().toString();
    String password = input2.getText().toString();

如果登录成功,它将通过意向调用活动。

If the login is successful, it will call the activity through intent.

推荐答案

如果您使用的是ApiLevel> = 5读关于<一个href="http://developer.android.com/reference/android/accounts/AccountManager.html">AccountManager.

If you are using ApiLevel >= 5 read about AccountManager.

这篇关于如何保存的Andr​​oid应用程序登录信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆