O'Reilly logo

Xamarin Studio for Android Programming: A C# Cookbook by Mathieu Nayrolles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Storing preferences

As said before, the Android platform has a built-in mechanism for storing simple key-value pairs. A good example of such a pair is theme=blue. Therefore, we will not reinvent the wheel on this or use advanced mechanisms such as database or programmer-handled files. In this recipe, we will simply use the built-in mechanisms and learn how they work.

Getting ready

In order to follow this recipe you must have Xamarin Studio or Visual Studio with the Xamarin Studio up and running. Then, create a new project named OnPhoneData for experiencing the recipes in this chapter.

How to do it...

In order to store user preferences using the mechanisms Android's engines have planted for us, we will create an object typed by the ISharedPreferences ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required