How to access storage in Android

When developing on Android, how to access the file system, such as /storage/emulated/0/aaa.txt.
I found that SpecialFolder.ExternalStorage.Child(“aaa.txt”) can read and write correctly, but SpecialFolder.ExternalStorage.Parent.Parent.Parent.Child(“aaa.txt”) will prompt that FolderItem is Nil.

dim x as new FolderItem(SpecialFolder.ExternalStorage.Parent.Parent.Parent.Child("aaa.txt"))
MessageBox(x.NativePath)
dim y as TextOutputStream=TextOutputStream.Create(x)
y.WriteLine("Hello world!")
y.Flush
y.Close

Android, like iOS, does not provide access to the full file system.

1 Like

Storage Access Framework?

I think the directories supported by SpecialFolder should be expanded, such as photo albums. If I need to use Canvas to draw a Picture and save it to the photo album, that is very useful.

2 Likes

I agree. Be sure create an Issue with the specifics of what you’d like to access.