Search code examples
androidpasswordssharedpreferences

How to save password in sharedpreference?


I have done login and registration activity using rest API. But in login I used only Mobile number editext. And in registration I used password. So I want to use that password in login. Means user should enter that password while he used during registraton. So how to do that?


Solution

  • If you're going to store passwords, make sure you store them in EncryptedSharedPreferences. You do not have to encrypt them manually as the library will take care of it.

    If you need/want more explanation on this and how it works, check out some articles about it on the web - there are plenty.