当前位置:网站首页>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 )
边栏推荐
- Reverse non return to zero code, Manchester code and differential Manchester code of common digital signal coding
- Common response status codes
- Attribute keywords aliases, calculated, cardinality, ClientName
- OAuth 2.0 + JWT 保护API安全
- LeetCode 648. Word replacement
- Leetcode——剑指 Offer 05. 替换空格
- Es log error appreciation -limit of total fields
- Demis Hassabis谈AlphaFold未来目标
- 数据流图,数据字典
- Beginner XML
猜你喜欢

Mrs offline data analysis: process OBS data through Flink job

Pert diagram (engineering network diagram)

libSGM的horizontal_path_aggregation程序解读
![GVIM [III] [u vimrc configuration]](/img/82/38355d7914e5fe490546347e57e35d.png)
GVIM [III] [u vimrc configuration]

小程序目录结构

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

PERT图(工程网络图)

Did login metamask

最长上升子序列模型 AcWing 1012. 友好城市

JS get the current time, month, day, year, and the uniapp location applet opens the map to select the location
随机推荐
请问指南针股票软件可靠吗?交易股票安全吗?
[network security] SQL injection syntax summary
低代码平台中的数据连接方式(下)
Is it safe to open an account online now? Which securities company should I choose to open an account online?
IP and long integer interchange
杭电oj2092 整数解
Regular expression integer positive integer some basic expressions
The difference between memory overflow and memory leak
UML sequence diagram (sequence diagram)
2022PAGC 金帆奖 | 融云荣膺「年度杰出产品技术服务商」
股票开户首选,炒股交易开户佣金最低网上开户安全吗
用例图
call undefined function openssl_cipher_iv_length
The longest ascending subsequence model acwing 1012 Sister cities
搜索引擎接口
OAuth 2.0 + JWT 保护API安全
请问,PTS对数据库压测有好方案么?
First choice for stock account opening, lowest Commission for stock trading account opening, is online account opening safe
Environment configuration
The longest ascending subsequence model acwing 482 Chorus formation