在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Tencent/MMKV开源软件地址(OpenSource Url):https://github.com/Tencent/MMKV开源编程语言(OpenSource Language):C++ 48.3%开源软件介绍(OpenSource Introduction):中文版本请参看这里 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 AndroidFeatures
Getting StartedInstallation Via MavenAdd the following lines to dependencies {
implementation 'com.tencent:mmkv:1.2.14'
// replace "1.2.14" with any available version
} Starting from v1.2.8, MMKV has been migrated to Maven Central. Quick TutorialYou can use MMKV as you go. All changes are saved immediately, no 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. PerformanceWriting random MMKV for iOS/macOSFeatures
Getting StartedInstallation Via CocoaPods:
For other installation options, see iOS/macOS Setup. Quick TutorialYou can use MMKV as you go, no configurations are needed. All changes are saved immediately, no - (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. PerformanceWriting random MMKV for Win32Features
Getting StartedInstallation Via Source
note:
For other installation options, see Win32 Setup. Quick TutorialYou can use MMKV as you go. All changes are saved immediately, no #include <MMKV/MMKV.h>
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 POSIXFeatures
Getting StartedInstallation Via CMake
For other installation options, see POSIX Setup. Quick TutorialYou can use MMKV as you go. All changes are saved immediately, no #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. LicenseMMKV is published under the BSD 3-Clause license. For details check out the LICENSE.TXT. Change LogCheck out the CHANGELOG.md for details of change history. ContributingIf 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 & FeedbackCheck out the FAQ first. Should there be any questions, don't hesitate to create issues. Personal Information Protection RulesUser privacy is taken very seriously: MMKV does not obtain, collect or upload any personal information. Please refer to the MMKV SDK Personal Information Protection Rules for details. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论