Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

Does the Hololens Emulator store persistent data?

Using the FileAccess sample from the Windows Universal Samples Master download, it is possible to demonstrate that if you use a PC as well as other platforms with UWP, you can successfully retrieve your data later. I have done this and it works fine on my PC. However when I tried adapting the code to run on the Hololens emulator, the file I wanted to retrieve did not exist. I use

string writetoken = StorageApplicationPermissions.FutureAccessList.Add(writefile, writefile.Name);

to store the StorageFile writefile and to read it:

     readfile = await StorageApplicationPermissions.FutureAccessList.GetFileAsync(token);
            if (readfile == null) return;
            readfilecontent = await FileIO.ReadTextAsync(readfile);

as I originally saved the metadata as just the name of this file (writefile.Name), I can then identify the token from going through the list of files available by comparing this name and retrieving the targeted token:-

        static public string Find_FALtoken_from_accesslist_metadata(string filename)
        {
            var fname = filename.ToLower();
            string token = "";
            AccessListEntryView entries;
            entries = StorageApplicationPermissions.FutureAccessList.Entries;
            foreach (AccessListEntry entry in entries)
            {

                var name = entry.Metadata;
                if (filename.ToLower().Equals(fname))
                {
                    token = entry.Token;
                    return token;
                }
            }
            return token;
        }

This process works fine used from my PC. But when incorporated into my Hololens app using the Hololens Emulator, it does not. Is this correct? It is probably wrong to expect it to but I hope someone can tell me definitively. Thanks

Best Answer

Answers

  • That seems to answer my question precisely. I guess it should work with file saving provided you do lose the emulator. I shall try that now. Thank you for getting back to me so promptly.

Sign In or Register to comment.