Book Image

Xamarin Mobile Application Development for Android

Book Image

Xamarin Mobile Application Development for Android

Overview of this book

Table of Contents (18 chapters)
Xamarin Mobile Application Development for Android Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 8. Creating Data Storage Mechanisms

We now turn our attention to data storage requirements. We need a way to store a list of Point of Interest (POI) data fetched from the server and make the list accessible when a device runs offline. This chapter shows how to use the built-in SQLite database engine to store and retrieve the POI data in a cross-platform way. The following topics will be covered in this chapter:

  • Approaches to data storage solutions

  • Different app storage options in Android

  • Using preferences to store key-value pairs

  • SQLite database storage in Xamarin.Android

  • Using the SQLite.NET ORM component

  • Performing database CRUD operations

  • Unit testing the Android app using NUnitLite

  • Implementing caching to POIApp

Data storage solutions mainly fall into two general categories: storing in Cloud using web services or using the device's local storage. Saving data in the Cloud provides great advantages over local data storage options, but in certain cases, such as apps that run offline or...