将密码临时存储在内存中 [英] Store password temporarily in memory

查看:86
本文介绍了将密码临时存储在内存中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种在Android应用程序中将密码存储在内存中的方法,只要该应用程序正在运行(参见不同的活动).我最初想到的是SharedPreferences,但随后将其保存在闪存中,我猜这对于密码来说不是那么好.

I'm looking for a way in an Android application to store a password within the memory as long as the application is running (cf. different activities). I was first thinking about the SharedPreferences, but then it's saved in the flash memory, which isn't that good for a password, I guess.

我不确定,最好的方法是什么.你会推荐我什么?

I'm unsure, what's the best way. What would you recommend me?

推荐答案

要将密码存储在与应用程序本身具有相同寿命的RAM中,只需将密码另存为静态成员即可.

To store a password in RAM with the same lifespan as the application itself, just save the password as a static member.

这篇关于将密码临时存储在内存中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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