Skip to content

Repository files navigation

Garum Build Status

Annotation style SharedPreferences.

Garum

How to use

Model

@Pref(name = "app_status")
publicclassAppStatusextendsPrefModel {
@PrefKeypublicStringappName;
@PrefKeypublicintstartupCount;
@PrefKeypublicbooleanshowNotification;
}

Save

AppStatusappStatus = newAppStatus();
appStatus.appName = "Garum";
appStatus.startupCount = ++appStatus.startupCount;
appStatus.showNotification = true;
appStatus.save();

XML

/data/data/[package name]/shared_prefs/app_status.xml

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<stringname="appName">Garum</string>
<intname="startupCount"value="10" />
<booleanname="showNotification"value="true" />
</map>

Documentation

Please refer to the Wiki.

Download

Download or grab via Maven:

<dependency>
<groupId>com.os.operando.garum</groupId>
<artifactId>garum</artifactId>
<version>0.9.0</version>
</dependency>

or Gradle:

compile 'com.os.operando.garum:garum:0.9.0'

ProGuard

# Garum
-keepclasseswithmembers class com.os.operando.garum.annotations.** {
*;
}
-keepclasseswithmembernames class * extends com.os.operando.garum.models.PrefModel {
*;
}

License

Apache Version 2.0

Copyright (C) 2014 Shinobu Okano
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.

About

Annotation style SharedPreferences

Topics

Resources

Stars

50 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages