日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > Android >内容正文

Android

MMKV_MMKV - 由微信开发的高效,小巧的移动端key-value存储框架,适用于iOS和Android...

發(fā)布時(shí)間:2023/12/20 Android 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 MMKV_MMKV - 由微信开发的高效,小巧的移动端key-value存储框架,适用于iOS和Android... 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

中文版本請(qǐng)參看這里

MMKV is an efficient, small, easy-to-use mobile key-value storage framework used in the WeChat application. It's currently available on Android, iOS/macOS, Win32 and POSIX.

MMKV for Android

Features

Efficient. MMKV uses mmap to keep memory synced with file, and protobuf to encode/decode values, making the most of Android to achieve best performance.

Multi-Process concurrency: MMKV supports concurrent read-read and read-write access between processes.

Easy-to-use. You can use MMKV as you go. All changes are saved immediately, no sync, no apply calls needed.

Small.

A handful of files: MMKV contains process locks, encode/decode helpers and mmap logics and nothing more. It's really tidy.

About 50K in binary size: MMKV adds about 50K per architecture on App size, and much less when zipped (apk).

Getting Started

Installation Via Maven

Add the following lines to build.gradle on your app module:

dependencies {

implementation 'com.tencent:mmkv-static:1.1.2'

// replace "1.1.2" with any available version

}

For other installation options, see Android Setup.

Quick Tutorial

You can use MMKV as you go. All changes are saved immediately, no sync, no apply calls needed.

Setup MMKV on App startup, say your Application class, add these lines:

public void onCreate() {

super.onCreate();

String rootDir = MMKV.initialize(this);

System.out.println("mmkv root: " + rootDir);

//……

}

MMKV has a global instance, that can be used directly:

import com.tencent.mmkv.MMKV;

MMKV kv = MMKV.defaultMMKV();

kv.encode("bool", true);

boolean bValue = kv.decodeBool("bool");

kv.encode("int", Integer.MIN_VALUE);

int iValue = kv.decodeInt("int");

kv.encode("string", "Hello from mmkv");

String str = kv.decodeString("string");

MMKV also supports Multi-Process Access. Full tutorials can be found here Android Tutorial.

Performance

Writing random int for 1000 times, we get this chart:

For more benchmark data, please refer to our benchmark.

MMKV for iOS/macOS

Features

Efficient. MMKV uses mmap to keep memory synced with file, and protobuf to encode/decode values, making the most of iOS/macOS to achieve best performance.

Easy-to-use. You can use MMKV as you go, no configurations needed. All changes are saved immediately, no synchronize calls needed.

Small.

A handful of files: MMKV contains encode/decode helpers and mmap logics and nothing more. It's really tidy.

Less than 30K in binary size: MMKV adds less than 30K per architecture on App size, and much less when zipped (ipa).

Getting Started

Installation Via CocoaPods:

Open terminal, cd to your project directory, run pod repo update to make CocoaPods aware of the latest available MMKV versions;

Edit your Podfile, add pod 'MMKV' to your app target;

Run pod install;

Open the .xcworkspace file generated by CocoaPods;

Add #import to your source file and we are done.

For other installation options, see iOS/macOS Setup.

Quick Tutorial

You can use MMKV as you go, no configurations needed. All changes are saved immediately, no synchronize calls needed. Setup MMKV on App startup, in your -[MyApp application: didFinishLaunchingWithOptions:], add these lines:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// init MMKV in the main thread

[MMKV initializeMMKV:nil];

//...

return YES;

}

MMKV has a global instance, that can be used directly:

MMKV *mmkv = [MMKV defaultMMKV];

[mmkv setBool:YES forKey:@"bool"];

BOOL bValue = [mmkv getBoolForKey:@"bool"];

[mmkv setInt32:-1024 forKey:@"int32"];

int32_t iValue = [mmkv getInt32ForKey:@"int32"];

[mmkv setString:@"hello, mmkv" forKey:@"string"];

NSString *str = [mmkv getStringForKey:@"string"];

MMKV also supports Multi-Process Access. Full tutorials can be found here.

Performance

Writing random int for 10000 times, we get this chart:

For more benchmark data, please refer to our benchmark.

MMKV for Win32

Features

Efficient. MMKV uses mmap to keep memory synced with file, and protobuf to encode/decode values, making the most of Windows to achieve best performance.

Multi-Process concurrency: MMKV supports concurrent read-read and read-write access between processes.

Easy-to-use. You can use MMKV as you go. All changes are saved immediately, no save, no sync calls needed.

Small.

A handful of files: MMKV contains process locks, encode/decode helpers and mmap logics and nothing more. It's really tidy.

About 10K in binary size: MMKV adds about 10K on application size, and much less when zipped.

Getting Started

Installation Via Source

Getting source code from git repository: git clone https://github.com/Tencent/MMKV.git

Add Win32/MMKV/MMKV.vcxproj to your solution;

Add MMKV project to your project's dependencies;

Add $(OutDir)include to your project's C/C++ -> General -> Additional Include Directories;

Add $(OutDir) to your project's Linker -> General -> Additional Library Directories;

Add MMKV.lib to your project's Linker -> Input -> Additional Dependencies;

Add #include to your source file and we are done.

note:

MMKV is compiled with MT/MTd runtime by default. If your project uses MD/MDd, you should change MMKV's setting to match your project's (C/C++ -> Code Generation -> Runtime Library), or vise versa.

MMKV is developed with Visual Studio 2017, change the Platform Toolset if you use a different version of Visual Studio.

For other installation options, see Win32 Setup.

Quick Tutorial

You can use MMKV as you go. All changes are saved immediately, no sync, no save calls needed.

Setup MMKV on App startup, say in your main(), add these lines:

#include

int main() {

std::wstring rootDir = getYourAppDocumentDir();

MMKV::initializeMMKV(rootDir);

//...

}

MMKV has a global instance, that can be used directly:

auto mmkv = MMKV::defaultMMKV();

mmkv->set(true, "bool");

std::cout << "bool = " << mmkv->getBool("bool") << std::endl;

mmkv->set(1024, "int32");

std::cout << "int32 = " << mmkv->getInt32("int32") << std::endl;

mmkv->set("Hello, MMKV for Win32", "string");

std::string result;

mmkv->getString("string", result);

std::cout << "string = " << result << std::endl;

MMKV also supports Multi-Process Access. Full tutorials can be found here Win32 Tutorial.

MMKV for POSIX

Features

Efficient. MMKV uses mmap to keep memory synced with file, and protobuf to encode/decode values, making the most of POSIX to achieve best performance.

Multi-Process concurrency: MMKV supports concurrent read-read and read-write access between processes.

Easy-to-use. You can use MMKV as you go. All changes are saved immediately, no save, no sync calls needed.

Small.

A handful of files: MMKV contains process locks, encode/decode helpers and mmap logics and nothing more. It's really tidy.

About 7K in binary size: MMKV adds about 7K on application size, and much less when zipped.

Getting Started

Installation Via CMake

Getting source code from git repository: git clone https://github.com/Tencent/MMKV.git

Edit your CMakeLists.txt, add those lines:

add_subdirectory(mmkv/POSIX/src mmkv)

target_link_libraries(MyApp

mmkv)

Add #include "MMKV.h" to your source file and we are done.

For other installation options, see POSIX Setup.

Quick Tutorial

You can use MMKV as you go. All changes are saved immediately, no sync, no save calls needed.

Setup MMKV on App startup, say in your main(), add these lines:

#include "MMKV.h"

int main() {

std::string rootDir = getYourAppDocumentDir();

MMKV::initializeMMKV(rootDir);

//...

}

MMKV has a global instance, that can be used directly:

auto mmkv = MMKV::defaultMMKV();

mmkv->set(true, "bool");

std::cout << "bool = " << mmkv->getBool("bool") << std::endl;

mmkv->set(1024, "int32");

std::cout << "int32 = " << mmkv->getInt32("int32") << std::endl;

mmkv->set("Hello, MMKV for Win32", "string");

std::string result;

mmkv->getString("string", result);

std::cout << "string = " << result << std::endl;

MMKV also supports Multi-Process Access. Full tutorials can be found here POSIX Tutorial.

License

MMKV is published under the BSD 3-Clause license. For details check out the LICENSE.TXT.

Change Log

Check out the CHANGELOG.md for details of change history.

Contributing

If you are interested in contributing, check out the CONTRIBUTING.md, also join our Tencent OpenSource Plan.

To give clarity of what is expected of our members, MMKV has adopted the code of conduct defined by the Contributor Covenant, which is widely used. And we think it articulates our values well. For more, check out the Code of Conduct.

FAQ & Feedback

Check out the FAQ first. Should there be any questions, don't hesitate to create issues.

總結(jié)

以上是生活随笔為你收集整理的MMKV_MMKV - 由微信开发的高效,小巧的移动端key-value存储框架,适用于iOS和Android...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 69国产成人精品二区 | 日韩精品久久久久久免费 | 一区二区精彩视频 | 性色国产成人久久久精品 | 久久精品5 | 苏晴忘穿内裤坐公交车被揉到视频 | 欧美日本韩国一区 | 久久中文免费视频 | h在线 | 国产精品久久久久久久久久直播 | 欧美三级视频在线播放 | 精品视频一区在线观看 | 免费观看黄色一级片 | 日韩av中文字幕在线 | 国产毛片18 | 精品国自产在线观看 | 91精品国产99久久久久久 | 亚洲视频导航 | 免费看黄色的视频 | 毛片网站入口 | 九九在线观看免费高清版 | 在线精品国产 | 日韩精品1区2区3区 欧美一本 | jjzz国产 | 日韩欧美性视频 | 一区二区三区四区精品 | 国产欧美一区二区三区沐欲 | 怡红院久久 | 亚洲情区 | 国产精品人妻 | 激情三级在线 | 亚洲狼人天堂 | 久久99久久98精品免观看软件 | 青青草视频在线免费观看 | av一区二区三 | 亚洲区中文字幕 | 美女尻逼视频 | 成熟丰满熟妇高潮xxxxx视频 | 日日夜夜欧美 | 午夜67194| 91精品婷婷国产综合久久竹菊 | 欧美1区2区3区 | 国产毛片高清 | 亚洲国产成人一区二区 | 国产一区二区成人 | 国产成人一区在线观看 | 九草av| 天堂色区 | 国产一区二区三区精品视频 | 第一色影院 | 黄色片在线视频 | 男人插女人免费视频 | 欧美被狂躁喷白浆精品 | 夜夜嗨av禁果av粉嫩av懂色av | 色先锋影院| 手机av免费在线 | 久久久午夜精品福利内容 | 自拍偷拍小视频 | 亚洲一区亚洲二区 | 少妇人妻一区二区三区 | 国产精品国产自产拍高清av | 黄色二级视频 | 精品国产99久久久久久宅男i | 毛片免 | 亚洲伊人婷婷 | 超级变态重口av番号 | 欧洲精品久久久久毛片完整版 | 久久官网 | 国产精品久久网站 | 亚洲av无码一区二区乱子伦 | 久久视频中文字幕 | 婷婷的五月 | 在线不卡一区二区 | 国产91熟女高潮一区二区 | 美女一区二区三区视频 | 亚洲人午夜精品 | 99热这里只有精品首页 | 青青操av在线 | 久久久视频在线观看 | av在线免费观看一区 | 日韩av一区二区三区 | 色呦呦国产 | 俺也来俺也去俺也射 | 亚洲天堂网一区二区 | 97超碰人人 | www.男人天堂.com | 成年人一级黄色片 | 色偷偷人人澡人人爽人人模 | 亚洲h片| 精品人伦一区二区三 | 国产在线精品一区 | 日本一区二区三区在线看 | 96精品视频 | 亚洲天天做 | 性久久| 日韩精品久 | 成人国产精品蜜柚视频 | 久久伊人超碰 | 欧美999 |