JavaScript appears to be disabled. We recommend you enable JavaScript while visiting this site.

(All original content on this site is licensed under the Creative Commons License Attribution-Noncommercial-No Derivative Works 3.0.)

Windows Phone 7: Taking and restoring a SQL database

As I develop my first Windows Phone 7 application, My Video Game Tracker, I want to make sure that the many games I've added won't accidentally be lost (as I'm deploying test versions to my physical phone).

The below assumes you're using Windows PowerShell, but they should run on the standard command line.

Taking screenshots of the application's data

When you install the Windows Phone SDK the Isolated Storage Explorer Tool is also installed. This tooll allows you to easily explore isolated storage on both emulated devices and any plugged in devices.

First you'll want to go to the directory where the tool is installed.

cd "C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.1\Tools\IsolatedStorageExplorerTool"

You can now enumerate devices if you want, but there's two parameters that you can tend to rely upon.

.\isetool.exe enumeratedevices

To continue, you'll need to have the guid of the application, which can be found in the WMAppManifest.xml file, and it's the ProductID attribute in the App element.

First, make sure that the application has been started, and any necessary data items have been setup.

Next get a directory listing, so you have an idea of what it looks like.

.\isetool.exe dir xd 00000000-0000-0000-0000-000000000000

This would return something like the following.

       131,072 AppData.sdf
<DIR>          Shared

Now you can take a screenshot to any directory you like. For example, to grab it from your phone (de = physical device):

.\isetool.exe ts de 00000000-0000-0000-0000-000000000000 D:\projects\JamesRSkemp\WindowsPhone\isolatedstorage

When you run this command you'll have a directory created in the above called IsolatedStore. This will mimic what the dir command above returns.

To take a screenshot of the default emulated device (512 MB emulator), run the above except with xd instead of de.

.\isetool.exe ts xd 00000000-0000-0000-0000-000000000000 D:\projects\JamesRSkemp\WindowsPhone\isolatedstorage

Restoring screenshots of the application's data

Now if you want to restore the screenshot you want to make sure you append IsolatedStorage to the end of the directory path.

.\isetool.exe rs xd 00000000-0000-0000-0000-000000000000 D:\projects\JamesRSkemp\WindowsPhone\isolatedstorage\IsolatedStore

Depending upon what you're storing, if you want to move data from one device to another, you can take a screenshot, replace the necessary file(s), and then restore the modified screenshot/directory.

Possible errors

As I've been developing I've run into two errors. The message and resolution are below.

Error: The process cannot access the file because it is being used by another process.

To resolve this error you need to close the application (back button from the home screen).

Error: Failed to connect to the device. Ensure that the device is completely booted and is connected to the PC.

To resolve this error you need to make sure Zune is running and the device is connected, and unlocked.

(All original content on this site is licensed under the Creative Commons License Attribution-Noncommercial-No Derivative Works 3.0.)

Script to simplify Netflix activity pages (in progress)

I love Netflix, but there's no easy way to get a listing of the movies I've rated through the service.

To ease with that, I've finally started on a script that will clean the Netflix output, so it's a bit easier to parse.

Fire up Chrome, visit either https://www2.netflix.com/RentalActivity?all=true or https://account.netflix.com/WiViewingActivity?all=true, open a console, and use the following two scripts:

Script 1: Load jQuery

var GM_JQ = document.createElement('script'); 
GM_JQ.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
GM_JQ.type = 'text/javascript'; 
document.getElementsByTagName('head')[0].appendChild(GM_JQ);

Script 2: Remove rating graphics

$('.stbrIl').hide();
$('.stbrMaskFg').css('background-image', 'none').css('text-indent', '0').css('width', '200px').css('vertical-aign', 'middle');
$('.stbrMaskBg').css('background-image', 'none');

There's still work to be done, but it's a sufficient start. I've thought about a user script, and might implement that once this is done.

Tags: ,

Categories: tutorials/guides

(All original content on this site is licensed under the Creative Commons License Attribution-Noncommercial-No Derivative Works 3.0.)

Migration from CollabNet Subversion to VisualSVN Server

Since it doesn't seem CollabNet is really going to keep their non-Edge Subversion application, I've decided to migrate to VisualSVN Server. Roughly, here are the steps I went through to migrate, which also includes a 1.6.x upgrade.

VisualSVN migration

  1. Installed VisualSVN. Repositories saved to C:\Repositories
  2. Setup existing users.
  3. Import existing repositories.
  4. Should already be upgraded, but upgrade to 1.5, just in case.
  5. Upgrade TortoiseSVN.
  6. Upgrade working copies to 1.7.