Chapter 16. Storing and Synchronizing Data

WHAT'S IN THIS CHAPTER

  • Saving application settings to isolated storage

  • Reading and writing to isolated storage

  • How to cache and persist objects

  • Strategies for synchronizing data

In the second part of working with data, this chapter delves into how you can persist data between application sessions. Rather than having to fetch data from an online source each time your application is run, you can periodically synchronize data into an application-specific data repository known as Isolated Storage.

Throughout this chapter you will learn how to wrap the saving and subsequent loading of data from Isolated Storage. You will also learn about the new OData (Open Data Protocol) standard and how the use of this standard can help build a synchronization framework that can improve the efficiency of your application.

ISOLATED STORAGE

The only form of persistent on-device storage that you can access from your Windows Phone application is what is known as Isolated Storage. As its name implies, this is storage that your application can read and write to that is isolated from other applications on the device. Your application is the only application that can read and write to the Isolated Storage allocated to your application. This prevents applications from sharing or interfering with data belonging to other applications.

If you are used to being able to read and write directly to the file system, then working with Isolated Storage may take a little getting used ...

Get Professional Windows® Phone 7 Application Development: Building Applications and Games Using Visual Studio, Silverlight®, and XNA® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.