当前位置:网站首页>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 )
边栏推荐
- Excuse me, does PTS have a good plan for database pressure measurement?
- Cesium knows the longitude and latitude of one point and the distance to find the longitude and latitude of another point
- Search engine interface
- Redis 核心数据结构 & Redis 6 新特性详
- UML state diagram
- 手里的闲钱是炒股票还是买理财产品好?
- When FC connects to the database, do you have to use a custom domain name to access it outside?
- Laravel5 call to undefined function OpenSSL cipher IV length() error php7 failed to open OpenSSL extension
- Verilog implementation of a simple legv8 processor [4] [explanation of basic knowledge and module design of single cycle implementation]
- UML sequence diagram (sequence diagram)
猜你喜欢

Use case diagram

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

UML 状态图

多商戶商城系統功能拆解01講-產品架構

UML sequence diagram (sequence diagram)

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

用例图

gvim【三】【_vimrc配置】

通过 iValueConverter 给datagrid 的背景颜色 动态赋值

常用数字信号编码之反向不归零码码、曼彻斯特编码、差分曼彻斯特编码
随机推荐
[network security] SQL injection syntax summary
请问,PTS对数据库压测有好方案么?
Navigation — 这么好用的导航框架你确定不来看看?
常用数字信号编码之反向不归零码码、曼彻斯特编码、差分曼彻斯特编码
Huawei image address
NLLB-200:Meta开源新模型,可互译200种语言
The longest ascending subsequence model acwing 1014 Mountaineering
Oracle Linux 9.0 正式发布
Laravel5 call to undefined function OpenSSL cipher IV length() error php7 failed to open OpenSSL extension
杭电oj2092 整数解
AI talent cultivation new ideas, this live broadcast has what you care about
libSGM的horizontal_path_aggregation程序解读
NDK beginner's study (1)
gvim【三】【_vimrc配置】
Docker deploy Oracle
2022PAGC 金帆奖 | 融云荣膺「年度杰出产品技术服务商」
Laravel form builder uses
Million data document access of course design
Lavarel之环境配置 .env
call undefined function openssl_ cipher_ iv_ length