javascriptuwpconstruct-2xbox-one

UWP Xbox One: Saving and loading data


A while back I got my hands on the UWP platform, specifically developing for Xbox One (or Windows 10 with a controller): it's worth noting that I am using Construct 2 to develop my app, so small snippets of JS would be easier to use than big chunks. I was looking for a way to save and load data (maybe in files) to and from the Xbox's storage and I would quite like a way to store locally on the Xbox's hard drive, although if this isn't possible I can use a cloud based system. I wasn't sure about whether I should be looking at a proper api or maybe just using cookies.

I have looked around the UWP js reference, and I can't seem to find a way of doing this that isn't just writing to files on the computer in Windows 10. Does anyone know anything that could help?


Solution

  • Depending on what exactly you are trying to store there are a few ways to do this in UWP apps.

    Take a look at the ApplicationData.Current class. It exposed properties for local files or settings and roaming files or settings.

    ApplicationData.Current.LocalSettings.Values["MySettingsKey"] = value;