Using the Windows Phone Isolated Storage Explorer tool

 

http://www.windowsphonegeek.com/tips/Using-the-Windows-Phone-Isolated-Storage-Explorer-tool

 

Using the Windows Phone Isolated Storage Explorer toolpublished on: 8/12/2011| Views: 1772| Tags: IsoStore

Rate Now!

by WindowsPhoneGeek

In this post I am going to talk about Windows Phone 7 Isolated Storage Explorer. This is a nice tool that helps developers explore the Windows Phone isolated storage.

Windows Phone 7 Isolated Storage Explorer is a free Open Source project published on Codeplex: http://wp7explorer.codeplex.com/

It can work both as a desktop application for testers or integrated in Visual Studio for developers. You can read the full description here.

NOTE: Although the project is considered to be in Beta we tested the product in details and as a conclusion it turns out to be stable enough and also quite helpful!

Why use it?

Here are some good reasons of why using this tool:

  • it is easy to install and use
  • you can check the state of the Isolated Storage of your Windows Phone apps
  • you can copy files from the Isolated Storage to your PC and vice versa

How to use WP7 Isolated Storage Explorer?

Step1: Download the installation .msi package from: http://wp7explorer.codeplex.com/

92-0

Step2: Install the downloaded "WP7 Isolated Storage Explorer v1.0 Beta.msi"

92-1

Step3:  Create a new Windows Phone 7.1 Project and add reference to IsolatedStorageExplorer.dll.

C:\Program Files (x86)\WP7 Isolated Storage Explorer\Library\IsolatedStorageExplorer.dll

92-2

Step4: Call "IsolatedStorageExplorer.Explorer.Start("<hostname>")" in the Launching event in App.xaml.cs.

Note: <hostname> is the host name or IP of the of the testing or development machine.

example:

1
2
3
4
private void Application_Launching(object sender, LaunchingEventArgs e)
{
    IsolatedStorageExplorer.Explorer.Start("localhost");
}

Step5: Add the call to "IsolatedStorageExplorer.Explorer.RestoreFromTombstone()" in the handler for the Activated event in App.xaml.cs:

1
2
3
4
private void Application_Activated(object sender, ActivatedEventArgs e)
{
    IsolatedStorageExplorer.Explorer.RestoreFromTombstone();
}

According to the official documentation: The WP7 Isolated Storage Explorer supports connections from the emulator or actual devices. For applications running on devices a data connection must be enabled (WiFi or the mobile data connection).  
It is not recommended to use the WP7 Isolated Storage Explorer on a device over a mobile data connection due to the traffic the application will generate, that might be charged by the mobile carrier.  
The development or testing machine's firewall must allow connections to the WP7 Isolated Storage Explorer Service on port 2502.

Step6:  Save a sample .txt file into IsolatedStorage like for example:

1
2
3
<StackPanel x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
    <Button Content="Save to IsoStore" Click="Button_Click"/>
</StackPanel>
1
2
3
4
5
6
7
8
9
10
11
12
private void Button_Click(object sender, RoutedEventArgs e)
{
    IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();
    //create new file
    using (StreamWriter writeFile = new StreamWriter(new IsolatedStorageFileStream("myFile.txt", FileMode.Create, FileAccess.Write, myIsolatedStorage)))
    {
        string someTextData = "This is some text data to be saved in a new text file in the IsolatedStorage!";
        writeFile.WriteLine(someTextData);
        writeFile.Close();
    }
}

NOTE: For more info about Isolated Storage you can take a look at our of 12posts: All about WP7 Isolated Storage

Step7: Run your Windows Phone project and press the "Save to IsoStore" button so that the text file will be stored in to the Isolated Storage. Next run the Isolated Storage Explorer tool which you can find installed on your PC at the following folder:

C:\Program Files (x86)\WP7 Isolated Storage Explorer\DesktopClient\WP7 Isolated Storage Explorer.exe

92-4

Alternatively you can start the tool from Visual Studio: View->Other Windows-> WP7 Isolated Storage Explorer:

92-7

Here is how the result should look like:

92-3

Step8: You can also add a file from your computer directly to the Isolated Storage of your app without writing any code just by using the Isolated Storage Explorer tool context menu and selecting the "Add Existing Item" option:

92-5  92-6

In this post I demonstrated how quick and easy it is to explore the IsolatedStorage of your  Windows Phone app using the Windows Phone Isolated Storage Explorer. Here is the full source code:

I hope that the post was helpful.

posted on 2011-10-17 14:29  higirle  阅读(418)  评论(0编辑  收藏  举报