Reputation: 2815
In C# Windows Forms, System.Windows.Forms.Application.LocalUserAppDataPath
gives the path for the application data of a local, non-roaming user. What is its equivalent in a Xamarin Android app?
Upvotes: 1
Views: 3252
Reputation: 74104
Xamarin.Essentials has a method called FileSystem.AppDataDirectory
:
If you do not want to use Xamarin.Essentials package, you can just use the source code for the Android implementation:
re: https://github.com/xamarin/Essentials/blob/main/Xamarin.Essentials/FileSystem/FileSystem.android.cs
Or the Xamarin.Android docs for FilesDir
and using System.Environment.SpecialFolder
and their Android paths within your app's sandbox:
https://learn.microsoft.com/en-us/xamarin/android/platform/files/#working-with-internal-storage
Upvotes: 1