My problem is that I can't read my json file that I'm creating in c#. I need my longitude and latitude values in my js. I need these for creating a google maps webview. My js can't find/read this file. I'm not sure if this is the correct way of reading/making the json file.
With this I create my JSON file. The beginPositie has 2 variables: longitude and latitude.
public async Task Serialize(Coordinate beginPositie) { string json = JsonConvert.SerializeObject(beginPositie); StorageFolder localFolder = ApplicationData.Current.LocalFolder; StorageFile MarkersFile = await localFolder.CreateFileAsync("markers.json", CreationCollisionOption.ReplaceExisting); using (IRandomAccessStream textStream = await MarkersFile.OpenAsync(FileAccessMode.ReadWrite)) { using (DataWriter textWriter = new DataWriter(textStream)) { textWriter.WriteString(json); await textWriter.StoreAsync(); } } } This is my function for reading the JSON file in JS. The "Windows" can't be found and I don't know the reason for that. I have already included the scripts, installed the extension SDK for js but for a reason I can't add the reference to this SDK.
function getJSON() { //var uri = new Windows.Foundation.Uri('ms-appdata:///local/markers.json'); //json = Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri); $.ajax({ url: "ms-appdata:///local/markers.json", success: function (data) { json = JSON.parse(data); } }); }