当前位置:网站首页>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 )
边栏推荐
- 使用day.js让时间 (显示为几分钟前 几小时前 几天前 几个月前 )
- IP and long integer interchange
- 用例图
- 手把手教会:XML建模
- NLLB-200:Meta开源新模型,可互译200种语言
- 设备故障预测机床故障提前预警机械设备振动监测机床故障预警CNC震动无线监控设备异常提前预警
- UML 顺序图(时序图)
- Did login metamask
- Reverse non return to zero code, Manchester code and differential Manchester code of common digital signal coding
- 搜索框效果的实现【每日一题】
猜你喜欢

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

内部排序——插入排序

gvim【三】【_vimrc配置】

UML 状态图

XML文件的解析操作

使用day.js让时间 (显示为几分钟前 几小时前 几天前 几个月前 )

Assign a dynamic value to the background color of DataGrid through ivalueconverter

How to check the ram and ROM usage of MCU through Keil

Did login metamask

docker部署oracle
随机推荐
SSRF vulnerability file pseudo protocol [netding Cup 2018] fakebook1
请问,在使用flink sql sink数据到kafka的时候出现执行成功,但是kafka里面没有数
The meaning of variables starting with underscores in PHP
[network security] SQL injection syntax summary
设备故障预测机床故障提前预警机械设备振动监测机床故障预警CNC震动无线监控设备异常提前预警
CVPR2022 | 医学图像分析中基于频率注入的后门攻击
Csma/cd carrier monitoring multipoint access / collision detection protocol
Es log error appreciation -limit of total fields
First choice for stock account opening, lowest Commission for stock trading account opening, is online account opening safe
CSMA/CD 载波监听多点接入/碰撞检测协议
请问指南针股票软件可靠吗?交易股票安全吗?
接口自动化测试-接口间数据依赖问题解决
交换机和路由器的异同
NLLB-200:Meta开源新模型,可互译200种语言
ndk初学习(一)
Leetcode——236. 二叉树的最近公共祖先
call undefined function openssl_ cipher_ iv_ length
Horizontal of libsgm_ path_ Interpretation of aggregation program
Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
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