Top 10 Things You Should Know About Using Isolated Storage in Your Windows Phone Application

Introduction

Isolated storage for the Windows Phone platform works a little differently than Isolated Storage for Silverlight. Here is a compilation of the top 10 things Windows Phone developers should know about using isolated storage in their application.

  1. Application update - When an application is updated, its isolated storage location is not changed. For that to take effect, you need to ensure you build your application and submit the application as if it was an upgraded version. Astute developers should test the upgrade scenarios to ensure successful data migration.
  2. Quota limitations - Unlike Silverlight applications, Windows Phone applications do not have a quota for the isolated storage. This allows applications to take up a lot of space. Be deliberate in your application design when you use disk space on the phone.
  3. Application uninstall - When a Windows Phone application is uninstalled, its isolated storage data will be deleted.
  4. Temporary cache - For data that is short-lived, make sure you store it in a temporary folder inside the isolated storage, which is cleaned up upon application exit. This ensures that your application does not gobble up disk space unnecessarily.
  5. For user generated data, if possible, store it in the cloud with Azure platform. This ensures that when the user formats the device, he/she does not lose the data. If cloud storage is not possible, make sure there is a dedicated folder in the isolated storage for that.
  6. IsolatedStorageSettings is not threadsafe and can throw IsolatedStorageException when Save is called.
  7. Data binding - Since the Save method on the "IsolatedStorageSettings" class throws an exception, if there are any data bound objects in IsolatedStorageSettings, and they need to be saved, create a clone of the object and save that.
  8. Always call all isolated storage API calls inside a try/catch block, so you can handle any exception throws without taking down the application and can inform the user.
  9. When the phone begins to run out of disk space, it will give the user a warning.
  10. Do not use isolated storage to store high-value secrets, such as unencrypted keys or passwords, because isolated storage is not protected from highly trusted code, or from unmanaged code. On an unlocked device, that could mean your application can be susceptible.

Summary

In this article, we saw various best practices about using isolated storage in your windows phone application. I hope you have found this information useful and will be able to use the knowledge to write better Windows Phone applications.



About the Author

Vipul Vipul Patel

Vipul Patel is a Software Engineer currently working at Microsoft Corporation, working in the Office Communications Group and has worked in the .NET team earlier in the Base Class libraries and the Debugging and Profiling team. He can be reached at vipul_d_patel@hotmail.com

Related Articles

Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: May 11, 2015 @ 1:00 p.m. ET / 10:00 a.m. PT One of the languages that have always been supported with the Intel® RealSense™ SDK (Software Developer Kit) is JavaScript, specifically so that web-enabled apps could be created. Come hear from Intel Expert Bob Duffy as he reviews his own little "space shooting" game where the orientation of your face controls the aiming reticle to help teach developers how to write apps and games in JavaScript that can use facial and gesture …

  • Live Event Date: April 30, 2015 @ 1:00 p.m. ET / 10:00 a.m. PT It's likely today that you'll need to recover a single database far more than you'll need to recover all of SQL Server – and yet, your backup and recovery strategy focuses on recovering the enterprise, and not daily recovery needs of that enterprise. Join Rick Vanover from Veeam, as we discuss the hype and reality of recovering your SQL databases at a granular level, tools vs. backups, where virtualization fits in, and how to successfully …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date