当前位置:网站首页>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 )
边栏推荐
- Beginner XML
- Excuse me, does PTS have a good plan for database pressure measurement?
- Reverse non return to zero code, Manchester code and differential Manchester code of common digital signal coding
- Demis Hassabis谈AlphaFold未来目标
- Data flow diagram, data dictionary
- How can the PC page call QQ for online chat?
- 一文读懂数仓中的pg_stat
- LeetCode 648. 单词替换
- Multi merchant mall system function disassembly lecture 01 - Product Architecture
- Codes de non - retour à zéro inversés, codes Manchester et codes Manchester différentiels couramment utilisés pour le codage des signaux numériques
猜你喜欢

Transferring files between VMware and host

PERT图(工程网络图)

Reverse non return to zero code, Manchester code and differential Manchester code of common digital signal coding

UML 顺序图(时序图)

内部排序——插入排序

Mrs offline data analysis: process OBS data through Flink job

Vmware 与主机之间传输文件

低代码平台中的数据连接方式(下)

Use day JS let time (displayed as minutes, hours, days, months, and so on)

GAN发明者Ian Goodfellow正式加入DeepMind,任Research Scientist
随机推荐
Laravel form builder uses
最长上升子序列模型 AcWing 1012. 友好城市
The longest ascending subsequence model acwing 482 Chorus formation
Excuse me, I have three partitions in Kafka, and the flinksql task has written the join operation. How can I give the join operation alone
UML 状态图
用例图
Huawei image address
Realization of search box effect [daily question]
requires php ~7.1 -> your PHP version (7.0.18) does not satisfy that requirement
Parameter keywords final, flags, internal, mapping keywords internal
Multi merchant mall system function disassembly lecture 01 - Product Architecture
C # switch pages through frame and page
js 获取当前时间 年月日,uniapp定位 小程序打开地图选择地点
Hangdian oj2054 a = = B? ???
The longest ascending subsequence model acwing 1014 Mountaineering
3D Detection: 3D Box和点云 快速可视化
SAKT方法部分介绍
【网络安全】sql注入语法汇总
Did login metamask
Laravel5 call to undefined function openssl cipher iv length() 报错 PHP7开启OpenSSL扩展失败