How to use internal storage to store files on Android 11

Anonymous
2023-07-07T13:20:53.7233333+00:00

Hi Yonglun,

Android 11 has a restriction to access external storage, and need users give the permission.

I need to find a way to skip the "users' permission".

Is it possible to store files in a public folder of internal storage without needing users' permission?

If yes, can you please me same sample code?

Thanks!

Kevin

Developer technologies | .NET | Xamarin
Developer technologies | .NET | Other
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2023-07-10T06:01:47.8+00:00

    Hello,

    Is it possible to store files in a public folder of internal storage without needing users' permission?

    Firstly, public folder is external storage, if you need to access it that need users give the permission.

    If you want to store file without permission, you can store it in the application internal storage with Xamarin.Essentials: File System Helpers by var mainDir = FileSystem.AppDataDirectory; path.

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.