.NET MAUI & Storage, Part 3 - Where to save application data

Поделиться
HTML-код
  • Опубликовано: 20 авг 2024
  • In this video, Daniel will show you where to save/store application data depending on what type of data you want to save.

Комментарии • 25

  • @earthlingthings
    @earthlingthings 20 дней назад

    I'm trying to simply list the image file names from the resources/images folder via code. Any help locating the path ?

  • @Meisme1834
    @Meisme1834 Год назад

    Thank you for this video. Exactly what I was looking for!

  • @first8208
    @first8208 Месяц назад

    great work! do we need to set permissions on android to save to files?

  • @NoFeetOnEarth
    @NoFeetOnEarth Месяц назад

    Is there an easy way to save and encrypt a somewhat large JSON file?

  • @DINESHKUMAR-pk4kv
    @DINESHKUMAR-pk4kv 3 месяца назад

    How to multiple permission set and get securedstorage

  • @communism8037
    @communism8037 2 месяца назад

    What about another path to save files? I cant reach it

  • @GerardoFerrari
    @GerardoFerrari 6 месяцев назад

    great videos, thanks!

  • @gbthakkar
    @gbthakkar Год назад

    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.

  • @simonestura8841
    @simonestura8841 Год назад

    Really awsome. Thank you so much

  • @zakariaje3197
    @zakariaje3197 Год назад

    You are the best

  • @therealamtdev
    @therealamtdev 5 месяцев назад

    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.

    • @DanielHindrikes
      @DanielHindrikes  5 месяцев назад

      You should not need any. Maybe a linker issue?

    • @therealamtdev
      @therealamtdev 5 месяцев назад

      Not sure but I published it in debug mode and it works as expected...hmm@@DanielHindrikes

  • @user-tv1hl9fv1o
    @user-tv1hl9fv1o 11 месяцев назад

    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.

  • @user-vf5du6dz6u
    @user-vf5du6dz6u 9 месяцев назад

    thank you so much, How i can save an image from Image contorl to Local AppDataDirectory

    • @DanielHindrikes
      @DanielHindrikes  5 месяцев назад

      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.

  • @leemaggiefyer6439
    @leemaggiefyer6439 Год назад

    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?

    • @LEGIT_ELITE
      @LEGIT_ELITE Год назад

      Did you ever figure this out?

  • @ake1818
    @ake1818 Год назад

    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?

    • @DanielHindrikes
      @DanielHindrikes  Год назад

      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

  • @user-yc8ki8jq3t
    @user-yc8ki8jq3t Год назад

    Thanks

  • @topunixfan5501
    @topunixfan5501 Год назад +1

    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();

    • @DanielHindrikes
      @DanielHindrikes  Год назад

      The File class have a couple of Read methoda that can be used.

  • @maharajas8195
    @maharajas8195 Год назад

    Hi how to add my existing sqlite file in app data directory?