locked
Should settings roaming work in debug builds?

    Question

  • I've made a universal app out of my Windows 8.1 game and thought it might be a good idea to have the settings roam between the Windows and Windows Phone versions. I changed one line in code to

    static ApplicationDataContainer settings = Windows.Storage.ApplicationData.Current.RoamingSettings;

    where I was using local storage before. I did of course expect that additional work would be needed (eg subsribe to the DataChanged event), but I also expected it to work somehow. Well, it didnt.

    I built and played the game on an actual Windows Phone device. Then I built the Windows 8.1 version and expected the app data to roam over from the phone. It didn't. Both apps store their settings locally just fine, but roaming didn't occur.

    So I guess my question is: Does roaming work in debug builds? If not, how do I test it? And if it should work: Any idea what I could be doing wrong?

    I have a static class SaveLoad that reads/writes settings like this:

            static public int LastLevel
            {
                get { return (int)settings.Values["LastLevel"]; }
                set { settings.Values["LastLevel"] = value; }
            }

    Many thanks in advance for any advice you guys might have.

    Sunday, September 14, 2014 7:21 PM

Answers

  • Problem solved. I startet a new project, copied over all the code from the old project and it the new solution roaming suddelny works. The exact same code still won't roam in the old solution. No idea what is wrong with the old project, but anyway, new one is working, that's most important. Thank you guys for your input.
    Monday, September 22, 2014 5:39 PM

All replies

  • Hi Raymond,

    > Does roaming work in debug builds? If not, how do I test it?

    Per my understanding, the answer is no. The reference below shows how to roam data between windows and phone store app. This approach need published app. see more from http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn630421.aspx.

    Windows doesn’t guarantee an instant sync for roaming data, roaming could be significantly delayed if a user is offline or on a high latency network. You can see more information about what can roaming data do and what cannot do in the following link. http://msdn.microsoft.com/en-us/library/windows/apps/hh465094.aspx.

    You mention that you want to roam LastLevel in your game. It’s more likely an instant value. I would recommend you use a game server to save the LastLevel value. When you windows store app or phone store app need the LastLevel, send a request to game server to get the current LastLevel. When the user pass the level, your apps can send a request to game server to save the new one.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, September 15, 2014 6:34 AM
    Moderator
  • Thank you Herro. I now linked the app to the store as your link describes (it wasn't linked since I started a new project when going for the universal app) and have yet to try if that changes anything. If not, I wonder how other developers test their roaming-features?

    Anyway. I thought if I get roaming "for free" I would use it. If it involves setting up a game server, I guess I will rather stay with locally saved games ;-)

    Many thanks,

    Ray

    Wednesday, September 17, 2014 4:36 PM
  • Hi Ray,

    Roaming is a great solution for the sort of thing you're talking about here. There is no need to set up a game server to share state between instances by the same user.

    The advantage to using a game server would be if you wanted to share information between multiple users or on different platforms. For example, you can set up a global high score list in an Azure Mobile Service to let users compare their scores with other players.

    Roaming settings are designed for cases like yours where you want to save the current state of the app (or game) on one system and then pick it up in the same place on another.

    Roaming does not require the app be published and should work during testing. It doesn't roam immediately though so you may need to give it a bit of time.

    --Rob

    Wednesday, September 17, 2014 7:35 PM
    Owner
  • Roaming does not require the app be published and should work during testing. It doesn't roam immediately though so you may need to give it a bit of time.

    For whatever reason roaming doesn't work for me. The roaming settings are stored locally on each device (Windows 8.1 PC, Windows Phone 8.1 device), but they just do not roam over to the other device. I did give it quit some time, we are talking hours here. I had hoped that binding the solution to the app that's already in the store would change that behaviour, but it didn't.

    Any ideas? Settings roaming is allowed on each device as far as I can see. I have yet to test if the problem also occurs between two Windows Devices. Only tested it between Windows and Windows Phone yet.

    Edit: I've now also tested it with a second Windows 8.1 device. No roaming happening. Ideas, anyone? :-(
    • Edited by Raymond AT Friday, September 19, 2014 10:29 PM
    Friday, September 19, 2014 6:10 AM
  • See the testing section in the Guidelines for Roaming app data
    Saturday, September 20, 2014 2:42 AM
    Owner
  • See the testing section in the Guidelines for Roaming app data

    I've looked at this already. I also ran the code sample from that page. With the code sample roaming works just fine. But in my app there's no roaming taking place and I cannot understand why. For test purposes I dumped my composite settings, fearing that something might be broken there and just tried to roam a simple value trough the "HighPriority" setting. No success. It is stored locally, but it just doesnt roam.

    Here's the involved part of my SavedLoad_Roaming class:

        class SaveLoad_Roaming
        {
            ApplicationDataContainer roamingSettings  = null;
    
            public SaveLoad_Roaming()
            {
                roamingSettings = ApplicationData.Current.RoamingSettings;
            }
    
            public bool CloudSavePresent
            {
                get
                {   
                    if (roamingSettings.Values["HighPriority"] == null)
                        return false;
                    else
                        return true;
                }
            }
    
            public void WriteRoamingSettings()
            {
    
                roamingSettings.Values["HighPriority"] = 10;
            }
        }
    }

    I use CloudSavePresent to check if roaming data is available. When WriteRoamingSettings() has written the data, CloudSavePresent returns true. So the data is there locally. But it just doesn't roam to another device. And this involves the exact same devices where the code sample from your link works fine.

    I just don't get it. If you have any ideas...

    Edit: PS: I just tried this little piece of code in a new project and guess what: I works. It still won't work in the project I want to use it in. Hmm.

    • Edited by Raymond AT Sunday, September 21, 2014 7:03 PM
    Saturday, September 20, 2014 5:44 PM
  • Problem solved. I startet a new project, copied over all the code from the old project and it the new solution roaming suddelny works. The exact same code still won't roam in the old solution. No idea what is wrong with the old project, but anyway, new one is working, that's most important. Thank you guys for your input.
    Monday, September 22, 2014 5:39 PM