### Apache License 2.0 Boilerplate Notice Source: https://github.com/pixplicity/easyprefs/blob/master/license.txt This is the standard boilerplate notice to attach to your work to apply the Apache License, Version 2.0. Replace '[yyyy]' with the copyright year and '[name of copyright owner]' with the actual copyright holder's name. This text should be enclosed in the appropriate comment syntax for the file format. ```Text Copyright [yyyy] [name of copyright owner] 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. ``` -------------------------------- ### EasyPrefs Basic Data Storage and Retrieval Methods Source: https://github.com/pixplicity/easyprefs/blob/master/README.md After initialization, EasyPrefs provides simple one-line methods for saving and retrieving various data types to/from shared preferences. It handles null checks automatically. ```APIDOC Prefs.putString(key, string) Prefs.putLong(key, long) Prefs.putBoolean(key, boolean) String data = Prefs.getString(key, default value) ``` -------------------------------- ### Initialize EasyPrefs in Android Application Class Source: https://github.com/pixplicity/easyprefs/blob/master/README.md This code demonstrates how to initialize the EasyPrefs library within the `onCreate` method of your Android `Application` class. It sets the context, mode, preference name, and enables the use of default shared preferences. ```Java public class PrefsApplication extends Application { @Override public void onCreate() { super.onCreate(); // Initialize the Prefs class new Prefs.Builder() .setContext(this) .setMode(ContextWrapper.MODE_PRIVATE) .setPrefsName(getPackageName()) .setUseDefaultSharedPreference(true) .build(); } } ``` ```Kotlin class PrefsApplication : Application() { override fun onCreate() { super.onCreate() // Initialize the Prefs class Prefs.Builder() .setContext(this) .setMode(ContextWrapper.MODE_PRIVATE) .setPrefsName(packageName) .setUseDefaultSharedPreference(true) .build() } } ``` -------------------------------- ### EasyPrefs Apache 2.0 License Source: https://github.com/pixplicity/easyprefs/blob/master/README.md The license text for the EasyPrefs library, specifying terms under the Apache License, Version 2.0. ```License Copyright 2014 Pixplicity (http://pixplicity.com) 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. ``` -------------------------------- ### Add EasyPrefs Gradle Dependency Source: https://github.com/pixplicity/easyprefs/blob/master/README.md This snippet shows how to add the EasyPrefs library as a dependency in your Android project's `build.gradle` file using Gradle. ```Groovy dependencies { implementation 'com.pixplicity.easyprefs:EasyPrefs:1.10.0' } ``` -------------------------------- ### EasyPrefs Ordered String Set Methods Source: https://github.com/pixplicity/easyprefs/blob/master/README.md EasyPrefs extends Android's `getStringSet` functionality by providing methods to store and retrieve ordered sets of strings, addressing the issue of order not being preserved in default Android implementations. These methods use Java's `LinkedHashSet` internally and support pre-Honeycomb devices. ```APIDOC void Prefs.putOrderedStringSet(String key, Set value); Set Prefs.getOrderedStringSet(String key, Set defaultValue); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.