Thank you for this video. Now since I have LiteDb in AppDataDirectory, I want to copy that in Gallary or some other folder as backup. Then attached my phone to computer and may be copy to computer as well. I would like to see how that can be done in Android using MAUI. So if you can make a video on that, that will be very helpful. Thank you.
what entitlements are needed to store your sqlite db in the app data folder in an apple store iOS distribution? my app runs as expected when run in debug mode on ipad and maccatalyst but crashes when I publish to store. I can see that no db is created which causes the crash.
Depends on what control you are using. But most controls will give you a stream or a byter[]. You should be able to just write it to the storage with the File.Write method.
Thanks for this video, Would you please tell me how can I save the uploaded picture to the database? could I save the uploaded picture using this method and save the path in to the database for retrieval when displaying the picture?
Maybe this about bundle files can help you, learn.microsoft.com/en-us/dotnet/maui/platform-integration/storage/file-system-helpers?tabs=android#bundled-files
Excellent! And how do we read back from memory what we already saved? Edited: I'm a newbie, and many times I don't know exactly what I'm doing. My intention was to read/write a JSON file. I tried your way and for some reason it didn't work for me. After much struggle this is what worked. I hope it helps someone. FOR WRITING: // Use fullPath to create the outputStream using FileStream outputStream = File.OpenWrite(fullPath); // Extract object properties to a string variable string jsonData = JsonConvert.SerializeObject(aWorkingObject); // Write string variable content to fullPath in device memory using StreamWriter streamWriter = new StreamWriter(outputStream); await streamWriter.WriteAsync(jsonData); FOR READING: // Use fullPath to create the fileStream using Stream fileStream = File.OpenRead(fullPath); // create the reader using StreamReader reader = new StreamReader(fileStream); // read the contents of the FloatVals.json file from internal memory string jsonData = await reader.ReadToEndAsync();
I'm trying to simply list the image file names from the resources/images folder via code. Any help locating the path ?
Thank you for this video. Exactly what I was looking for!
great work! do we need to set permissions on android to save to files?
Is there an easy way to save and encrypt a somewhat large JSON file?
How to multiple permission set and get securedstorage
What about another path to save files? I cant reach it
great videos, thanks!
Thank you for this video.
Now since I have LiteDb in AppDataDirectory, I want to copy that in Gallary or some other folder as backup. Then attached my phone to computer and may be copy to computer as well.
I would like to see how that can be done in Android using MAUI. So if you can make a video on that, that will be very helpful. Thank you.
Really awsome. Thank you so much
You are the best
what entitlements are needed to store your sqlite db in the app data folder in an apple store iOS distribution? my app runs as expected when run in debug mode on ipad and maccatalyst but crashes when I publish to store. I can see that no db is created which causes the crash.
You should not need any. Maybe a linker issue?
Not sure but I published it in debug mode and it works as expected...hmm@@DanielHindrikes
Hi can I know how do you delete the file saved? I send the File.Delete command. It is not throwing any error however the file is not deleted.
thank you so much, How i can save an image from Image contorl to Local AppDataDirectory
Depends on what control you are using. But most controls will give you a stream or a byter[]. You should be able to just write it to the storage with the File.Write method.
Thanks for this video, Would you please tell me how can I save the uploaded picture to the database? could I save the uploaded picture using this method and save the path in to the database for retrieval when displaying the picture?
Did you ever figure this out?
very helpful, I want to save a list to a xml file and read this file to a list since every open this app. how to do it?
Maybe this about bundle files can help you, learn.microsoft.com/en-us/dotnet/maui/platform-integration/storage/file-system-helpers?tabs=android#bundled-files
Thanks
Excellent!
And how do we read back from memory what we already saved?
Edited:
I'm a newbie, and many times I don't know exactly what I'm doing. My intention was to read/write a JSON file. I tried your way and for some reason it didn't work for me. After much struggle this is what worked. I hope it helps someone.
FOR WRITING:
// Use fullPath to create the outputStream
using FileStream outputStream = File.OpenWrite(fullPath);
// Extract object properties to a string variable
string jsonData = JsonConvert.SerializeObject(aWorkingObject);
// Write string variable content to fullPath in device memory
using StreamWriter streamWriter = new StreamWriter(outputStream);
await streamWriter.WriteAsync(jsonData);
FOR READING:
// Use fullPath to create the fileStream
using Stream fileStream = File.OpenRead(fullPath);
// create the reader
using StreamReader reader = new StreamReader(fileStream);
// read the contents of the FloatVals.json file from internal memory
string jsonData = await reader.ReadToEndAsync();
The File class have a couple of Read methoda that can be used.
Hi how to add my existing sqlite file in app data directory?
Where so you have it now?