Windows Store App

YDN-DB todo list demo app built by WinJS for Windows Store App.

Windows Store App

Windows Store App for using YDN-DB javascript database library on HTML5 platform. The example include loading resource data file into the database.

Bundling data to load into database

It is commonly required that to ship some data together with the application. We can fetch require files from the server, but to work on offline scenario, we can bundle data files together with the application. The follow code snippet shows loading JSON data from the resource file to YDN-DB database.

var url = new Windows.Foundation.Uri("ms-appx:///data/data.json");
Windows.Storage.StorageFile.getFileFromApplicationUriAsync(url).then(function (file) {
    Windows.Storage.FileIO.readTextAsync(file).then(function (text) {
        var json = JSON.parse(text);
        db.put('todo', json).done(function () {
            getAllTodoItems();
        });
    });
});

Source code in MSDN

Visual Studio Community 2013 is required to build the solution.

Authors

Kyaw Tun