map组织储存_有组织的安全存储-EncryptedSharedPreferences

map组织储存

Android recently released a couple crypto application program interfaces (APIs) as part of Android Jetpack which are EncryptedSharedPreferences and EncryptedFile. We’ll be focusing on EncryptedSharedPreferences and show how to build a generic abstraction on top that allows the developer to not only provide secure storage of arbitrary data, but also re-think the usage of preferences.

Android最近发布了几个加密应用程序接口(API)作为Android Jetpack的一部分,分别是EncryptedSharedPreferencesEncryptedFile 。 我们将专注于EncryptedSharedPreferences并展示如何在其上构建通用的抽象,该抽象使开发人员不仅可以提供任意数据的安全存储,还可以重新考虑首选项的用法。

储存资料 (Storing data)

There are a few different ways of storing data depending on the use case. Here are a few to mention:

根据使用情况,有几种不同的数据存储方式。 这里有几点要提:

共享首选项 (SharedPreferences)

SharedPreferences provides an abstraction over a flat file on disk that allows for writing key/value pairs to a clear text file in your app’s directory. Under normal situations this is perfectly secure as your app’s directory is protected by Android’s sandbox environment.

SharedPreferences提供了磁盘上平面文件的抽象,该抽象允许将键/值对写入应用程序目录中的明文文件。 在正常情况下,这是绝对安全的,因为您应用的目录受Android沙箱环境的保护。

SQLite的 (SQLite)

For large volumes of data that need to be queried often, or used as part of UI rendering, the developer will likely be using a SQLite database. The recommended abstraction over SQLite is to use Room rather than SQLite directly but it’s still SQLite behind the scenes.

对于需要经常查询或用作UI渲染一部分的大量数据,开发人员可能会使用SQLite数据库。 推荐的对SQLite的抽象是直接使用

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值