当前位置:网站首页>Mmkv use and principle
Mmkv use and principle
2022-07-07 14:22:00 【LLAiden】
Basic use
implementation 'com.tencent:mmkv-static:1.2.9'
MMKV.initialize(this);
MMKV kv = MMKV.defaultMMKV();
From the input parameters of the stored function above, we found that it is actually used key,value Next, let's look at the storage method
This storage method is actually a kind of packaging of the first storage method , But do it with SharedPreferences Basic compatibility in calling methods .
And SharedPreferences Compare
SharedPreferences
- advantage
1. Android Native support does not require the introduction of additional libraries
2. The data format is readable -
- shortcoming
1. The limitation of data format leads to more invalid data
2. Read and store using traditional IO It takes some time
3. The data format is limited, and the cost of local update is large
MMKV
- advantage
1. Use MMAP Mode and file mapping write time are greatly reduced
2. When local updates are appended to read later Map The mechanism automatically removes the weight
2. The number of customized data is invalid, and the amount of data is small
- shortcoming
1. Poor readability
2. Due to the increasing number of file addresses saved in the way of additional update ( When it reaches a certain amount, it will also be comprehensively updated to clean up duplicate data )
边栏推荐
猜你喜欢
LeetCode 648. 单词替换
OAuth 2.0 + JWT 保护API安全
The longest ascending subsequence model acwing 482 Chorus formation
docker部署oracle
js 获取当前时间 年月日,uniapp定位 小程序打开地图选择地点
MRS离线数据分析:通过Flink作业处理OBS数据
最长上升子序列模型 AcWing 1012. 友好城市
Verilog implementation of a simple legv8 processor [4] [explanation of basic knowledge and module design of single cycle implementation]
Vmware 与主机之间传输文件
PERT图(工程网络图)
随机推荐
Leetcode——236. The nearest common ancestor of binary tree
最长上升子序列模型 AcWing 1014. 登山
请问指南针股票软件可靠吗?交易股票安全吗?
WPF DataGrid realizes the UI interface to respond to a data change in a single line
CVPR2022 | 医学图像分析中基于频率注入的后门攻击
Flask session forged hctf admin
LeetCode 648. Word replacement
Cargo placement problem
Hands on Teaching: XML modeling
How can the PC page call QQ for online chat?
Verilog implementation of a simple legv8 processor [4] [explanation of basic knowledge and module design of single cycle implementation]
请问,如图,pyhon云函数提示使用了 pymysql模块,这个是怎么回事?
Analysis of arouter
Excuse me, as shown in the figure, the python cloud function prompt uses the pymysql module. What's the matter?
Pert diagram (engineering network diagram)
Hangdian oj2092 integer solution
請問,在使用flink sql sink數據到kafka的時候出現執行成功,但是kafka裏面沒有數
杭电oj2054 A == B ? ???
UML 状态图
UML sequence diagram (sequence diagram)