Storage on Windows 8 and Windows Phone (part 1)

As promised, here’s the recap of the “Local” storage on Windows 8 and Windows Phone part of my talk at the Windows 8 and Windows Phone camp in Zwolle, the Netherlands last week. In this first part we’ll go over the local and roaming storage options on Windows 8 and local storage capabilities on Windows Phone. Using SQLite warrants a post on its own!

IsolatedStorage on Windows Phone

Let’s start with the IsolatedStorage capability on Windows Phone. Back in October of 2010, Jeff Blankenburg wrote an excellent article that goes over IsolatedStorage on Windows Phone. As mentioned, it was introduced in Silverlight version 2, so if you’re familiar with that, you can just use it on Windows Phone. To refresh your memory, it’s the storage that’s available to your app and your app only. We have two main ways to access IsolatedStorage on Windows Phone: IsolatedStorageSettings and IsolatedStorageFile. As the name indicates, the first one is used for persisting settings in a key/value manner:

Just make sure to call the Save method when you want to persist your changes. In my own projects I use a simple helper class to easily use IsolatedStorageSettings that I found a while back. I can’t really remember (or find) where I got these from, so if it’s yours do let me know!

Using IsolatedStorageFile is slightly more complex, but still quite straightforward:

If you want to know more about the Reading/Writing/Deleting of files in IsolatedStorage, a good resource is—File-manipulations on

PhoneApplicationService.Current.State on Windows Phone

At times you will want to store data temporary to be used in the current user “session”, but not necessarily persist it to the phone’s storage. In this case you can use PhoneApplicationService.Current.State to save and load data that will be available in the current session. To do this, I use three simple helper classes in my projects (again, I apologize for not remembering the original source for these):

RoamingSettings on Windows 8

Windows 8 introduced the wonderful concept of roaming settings. What this means is that you as a developer get around 100kb of online roaming storage for your app’s settings. Usage of this mechanism could not be easier, as it’s pretty much the same as using the local settings on the device:

Note that there’s no need for a Save method on Windows 8.

RoamingFolder on Windows 8

There’s also an equivalent for roaming files and folders on Windows 8. To use it, I use the Storage Helper for Windows 8 class by Simon Jackson, with some minor additions (you can find it attached at the bottom of the post). The principle is the same as on Windows Phone, but because it’s roaming you will have to keep an eye on your usage in app. To do so, you can use the ApplicationData.RoamingStorageQuota property. Note that if you don’t want to roam, simply specify the LocalFolder or change the DefaultFolder in the class to


Windows 8 Storage Helper (451 downloads)
Windows Phone Storage Helper (516 downloads)

Pin It

2 thoughts on “Storage on Windows 8 and Windows Phone (part 1)

  1. Pingback: Storage on Windows 8 and Windows Phone (part 1)

  2. Pingback: Storage on Windows 8 and Windows Phone (part 1)

Leave a Reply

Your email address will not be published. Required fields are marked *