Blograby

Storage Considerations

Windows Phone 7 does not include a general-purpose file system or a local database. The only option for storing data on the phone is to use isolated storage via an API to access a virtual hierarchy of folders and files that is private to the application. Although third-party database mechanisms are likely to be available, you should consider whether the additional memory and resource overheads that a database will impose are necessary for your application. The majority of Windows Phone 7 applications will typically use only isolated storage.

Note: In future releases, there may be a database available on the phone; or you may alternatively consider using a third-party database that you install with your application.

When storing data in isolated storage, the most common approach is to store it as serializable collections. The Tailspin Surveys client application discussed in this book uses isolated storage to hold collections of surveys and their content.

Storage is limited on mobile devices when compared to desktop and notebook computers. The minimum specification for Windows Phone 7 devices is 256 MB of memory, though manufacturers are likely to install more than this. The phone can also accept extended memory of up to 8 GB using a flash card.

Isolated storage on the device is shared among operating system data, built-in applications, user content (such as downloaded media), and other applications that the user installs on the device. Being a “good citizen” is especially important on the phone because there is no limit to the amount of data that an application can store (there are no per-application storage quotas). This means that your applications must minimize their use of storage without causing a reduction in performance of the device and your application. The following are some recommendations for using storage on the device:

Note: Typically, you will see the following effects, depending on the serialization method you choose:

XML: Larger payload, higher CPU utilization
JSON without compression: Smaller payload, lower CPU utilization
JSON with compression: Smallest payload, higher CPU utilization

 

Exit mobile version