一款针对Android平台下Share preference 管理器
-最新版本
-如何引用
-进阶使用
-混淆配置
-如何提Issues
-License
- 把
maven { url 'https://jitpack.io' }加入到 repositories 中 - 添加如下依赖,末尾的「latestVersion」指的是PreferenceManager
里的版本名称,请自行替换。 使用Gradle
repositories {
google()
maven { url 'https://jitpack.io' }
}
dependencies {
// PictureSelector
implementation 'com.github.peihua8858:PreferenceManager:${latestVersion}'
}或者Maven:
<dependency>
<groupId>com.github.peihua8858</groupId>
<artifactId>PreferenceManager</artifactId>
<version>${latestVersion}</version>
</dependency>简单用例如下所示:
//初始化
PreferenceManager.initManager(context,sharedPreferences)
或
PreferenceManager.initManager(context)
//读取
PreferenceManager.read(key,defaultValue)
//保存
PreferenceManager.save(key,value)-keep class com.fz.premanager.** { *; }Copyright 2023 peihua
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.