Persisting data locally using the ApplicationData API and SQLite
While in a lot of cases data can be fetched from the internet, as we have seen in Chapter 4, Mobilizing Your App, there is often a need to persist data on users' devices. This might be the case for data that needs to be available even when there is no internet connection or data that is device-specific such as settings. We will start by persisting small chunks of data using the ApplicationData
API.
Storing data using the ApplicationData API
Since we will localize our app, we also want to give the users the possibility to choose the language of the app. To do this, first create a Models
folder inside our shared project and add a SettingsStore
class. Now, add the following code to the SettingsStore
class:
using Windows.Storage; public static class SettingsStore { private const string AppLanguageKey = "Settings.AppLanguage";...