Question

In Android, you can store user's config in "preferences" file. So where should the "preferences" being stored in a Metro app and how can this be accomplished?

Any example will help. Examples in Javascript would be the best.

Was it helpful?

Solution

You can use Windows.Storage.ApplicationData for this.

Example:

var applicationData = Windows.Storage.ApplicationData.current;

var userSetting= applicationData.localSettings.values.userSetting;

//First run ? set default value
if (userSetting) == "undefined"){
    applicationData.localSettings.values.userSetting= 1; 
}

You can also take a look at the Sample SDK app

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top