xamarin / Essentials

Xamarin.Essentials is no longer supported. Migrate your apps to .NET MAUI, which includes Maui.Essentials.
https://aka.ms/xamarin-upgrade
Other
1.53k stars 505 forks source link

AppDataDirectory not useful on Android #209

Closed Redth closed 6 years ago

Redth commented 6 years ago

Here's a bunch of file paths... it looks like all the ones with /data/usr/ in them fail to save, and /storage/emulated/0/ works well.

context.GetExternalFilesDir: /storage/emulated/0/Android/data/Camera2Basic.Camera2Basic/files
context.FilesDir: /data/user/0/Camera2Basic.Camera2Basic/files
Environment.SpecialFolder.Personal: /data/user/0/Camera2Basic.Camera2Basic/files

Personal: /data/user/0/com.xamarin.MOVAI/files/my.jpg
LocalApplicationData: /data/user/0/com.xamarin.MOVAI/files/.local/share/my.jpg
ApplicationData: /data/user/0/com.xamarin.MOVAI/files/.config/my.jpg
MyDocuments: /data/user/0/com.xamarin.MOVAI/files/my.jpg

We need to fix this on Android and figure out if there are differences in behaviour between android versions, specifically < API 23, and then API 27 might be different too.

jamesmontemagno commented 6 years ago

FilesDir is correct: https://developer.android.com/training/data-storage/files.html

What device is it failing on?

Redth commented 6 years ago

@davidortinau can you add bit about what you were testing on?

jamesmontemagno commented 6 years ago

Closing this for now as I don't think this is actually an issue.