Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Creating Cross-Platform C# Applications with Uno Platform

You're reading from   Creating Cross-Platform C# Applications with Uno Platform Build apps with C# and XAML that run on Windows, macOS, iOS, Android, and WebAssembly

Arrow left icon
Product type Paperback
Published in Aug 2021
Publisher Packt
ISBN-13 9781801078498
Length 258 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Marcel Alexander Wagner Marcel Alexander Wagner
Author Profile Icon Marcel Alexander Wagner
Marcel Alexander Wagner
Matt Lacey Matt Lacey
Author Profile Icon Matt Lacey
Matt Lacey
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Section 1: Getting to Know Uno Platform
2. Chapter 1: Introducing Uno Platform FREE CHAPTER 3. Chapter 2: Writing Your First Uno Platform App 4. Section 2: Writing and Developing Uno Platform Apps
5. Chapter 3: Working with Forms and Data 6. Chapter 4: Mobilizing Your App 7. Chapter 5: Making Your App Ready for the Real World 8. Chapter 6: Displaying Data in Charts and with Custom 2D Graphics 9. Section 3: Test, Deploy, and Contribute
10. Chapter 7: Testing Your Apps 11. Chapter 8: Deploying Your Apps and Going Further 12. Other Books You May Enjoy

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";...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime