Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

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.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. 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. 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.