官网链接:https://github.com/Tencent/MMKV
中文链接:https://github.com/Tencent/MMKV/blob/master/README_CN.md
在build.gradle中
implementation 'com.tencent:mmkv-static:1.2.7'
在activity的onCreate方法中初始化
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MMKV.initialize(this);
mmkv = MMKV.defaultMMKV();
setContentView(R.layout.activity_city_list);
bindData();
}
encode()存放key ,value
decode…通过key取出数据
其他更多