Using preferences in Android apps


show more Using preferences in Android apps provides you with in-depth training on Developer. Taught by David Gassner as part of the Android SDK: Local Data Storage show less
please wait ...

Using preferences in Android apps

The simplest and smallest sort of data that you can store persistently on disk in an Android app is called a preference. There are a couple of different ways of creating preferences in an application, and they are sometimes referred to as simply preferences and sometimes as shared preferences. You can initialize preferences either in Java code or through a preference activity--a visual interface that you create just like you do any activity. Each preference value is a simple key-value pair.

The keys are always strings, but the values can have one of a number of different types, including Booleans, integers, longs, floats, and strings. It's also possible to create a single preference value that consists of multiple strings that are typed as a Java set. You can create your preferences in Java by using a class called SharedPreferences. You start by creating an instance of this class. Whenever you create a SharedPreferences object, you always assign a mode, and the most common is called MOD...

Using preferences in Android apps
Video duration: 5m 28s 3h 41m Intermediate

Viewers:

Using preferences in Android apps provides you with in-depth training on Developer. Taught by David Gassner as part of the Android SDK: Local Data Storage

Subject:
Developer
Software:
Android Java
Author:
please wait ...