2
votes

I have created the universal app that works on Windows Store 8.1 and Windows Phone 8.1.

Those apps should have capability to use the common ApplicationData.Roaming folder. However, I am not sure what is the best way to debug this. As far as I am aware, roaming won't work until you upload the app to Windows Phone Store and mark it as the universal app there. But that doesn't seem like elegant solution for debugging. Am I missing something or it is like that?

4

4 Answers

1
votes

If you create a Universal app and deploy to Windows 8.1 and to Windows Phone 8.1 it should sync between the devices even if it's not published in the Store.

The make it work, first I played around Package.appxmanifest of both apps. In Package tab in Package.appxmanifest, I made sure that the Package name and Package display name were same for both apps. I also made sure that the Display name in Application tab is the same, although I don't think that this last one was needed, but don't have the time now to verify.

Long story short, making sure that the package information is the same, and that you're signed in on both devices with the same Microsoft account should work even in debug mode.

To test, in one app you can set a text value in a TextBox:

var roamingSettings = ApplicationData.Current.RoamingSettings;
roamingSettings.Values["Demo"] = TextBox.Text;

And in the other app, you can do this to display the same text in TextBlock:

var roamingSettings = ApplicationData.Current.RoamingSettings;
if (roamingSettings.Values.ContainsKey("Demo"))
{
    TextBlock.Text = roamingSettings.Values["Demo"].ToString();
}

It synced nicely between my phone and PC.

1
votes

It should work like the Local folder.

You can use IsoStoreSpy to see the content of those folders

They fully explain how roaming folder and settings work here: Building Apps for Windows Phone 8.1: (09) Data Storage, Backup, and Roaming

1
votes

Ok, I'm almost too embarrassed to post this but, the issue I was having was simply this: if you're running the app in the emulator, you'll need to setup your account in the emulator (zomg). Just go into Settings > email+accounts and add your Microsoft account.

0
votes

It seems that sometimes connection can get broken, and that was my problem. Uninstall the app to make it work again.