当前位置:网站首页>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 )
边栏推荐
- gvim【三】【_vimrc配置】
- LeetCode 648. 单词替换
- Cesium knows the longitude and latitude of one point and the distance to find the longitude and latitude of another point
- Leetcode - Sword finger offer 05 Replace spaces
- The longest ascending subsequence model acwing 1014 Mountaineering
- Démontage de la fonction du système multi - Merchant Mall 01 - architecture du produit
- Realization of search box effect [daily question]
- Leetcode——236. The nearest common ancestor of binary tree
- The reason why data truncated for column 'xxx' at row 1 appears in the MySQL import file
- 股票开户首选,炒股交易开户佣金最低网上开户安全吗
猜你喜欢

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

MRS离线数据分析:通过Flink作业处理OBS数据

Equipment failure prediction machine failure early warning mechanical equipment vibration monitoring machine failure early warning CNC vibration wireless monitoring equipment abnormal early warning
![Verilog implementation of a simple legv8 processor [4] [explanation of basic knowledge and module design of single cycle implementation]](/img/d3/20674983717d829489149b4d3bfedf.png)
Verilog implementation of a simple legv8 processor [4] [explanation of basic knowledge and module design of single cycle implementation]

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

UML 顺序图(时序图)

AutoCAD - how to input angle dimensions and CAD diameter symbols greater than 180 degrees?

常用数字信号编码之反向不归零码码、曼彻斯特编码、差分曼彻斯特编码

LeetCode每日一题(636. Exclusive Time of Functions)

js 获取当前时间 年月日,uniapp定位 小程序打开地图选择地点
随机推荐
請問,在使用flink sql sink數據到kafka的時候出現執行成功,但是kafka裏面沒有數
First choice for stock account opening, lowest Commission for stock trading account opening, is online account opening safe
Selenium Library
Data flow diagram, data dictionary
请问,如图,pyhon云函数提示使用了 pymysql模块,这个是怎么回事?
Clickhouse (03) how to install and deploy Clickhouse
Cargo placement problem
[AI practice] Application xgboost Xgbregressor builds air quality prediction model (II)
搜索引擎接口
UML 状态图
Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
CVPR2022 | 医学图像分析中基于频率注入的后门攻击
最长上升子序列模型 AcWing 482. 合唱队形
How to check the ram and ROM usage of MCU through Keil
ARM Cortex-A9,MCIMX6U7CVM08AD 处理器应用
Docker deploy Oracle
Vmware 与主机之间传输文件
gvim【三】【_vimrc配置】
Common response status codes
requires php ~7.1 -> your PHP version (7.0.18) does not satisfy that requirement