Android Question Create Folder with class module SaveAs?

gezueb

Active Member
Licensed User
Longtime User
I am trying to use SaveAS to store app created data in a subdirectory of the android documents folder using the code in the class module Filehandler. This works okay. But I need to store the data in a subfolder which should be named and created by my app.
When I try SaveAs to enter a /subdirsomething/filesomething.csv to store the data, the "/ " is converted to an underscore "_ "., which obviously is not my intention.
Is there a way in b4a to create programmatically a (sub)directory with the recent SDK's 30+ ?
 

gezueb

Active Member
Licensed User
Longtime User
Thank you, Erel. As most of my devices have no sd-card slot, this effectivly buries my intentions. I just wonder how other app developers are able to create filemanagers (like OI Filemanager) to circumvent the file access restrictions?
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
I just wonder how other app developers are able to create filemanagers (like OI Filemanager) to circumvent the file access restrictions?
They do not circumvent the restrictions. They negotiate a special case : I quote from Play Console Help - "Subject to Google Play review and approval."

But you might find this useful.
 
Upvote 0

gezueb

Active Member
Licensed User
Longtime User
Thanks, Brian, but I cannot get the example to work (SDK 33). In the example, the file dialog showasync remains blank, not showing any files or folders.
 
Upvote 0

gezueb

Active Member
Licensed User
Longtime User
I have found a workaround for my problem. Rather than picking all the relevant folders and files one by one with the ContentChooser, I put them into a zip archive. Thus, I can import the whole structure into the DirInternals in a single go by unzipping from wherever they might come (another app, download, by usb file transfer etc.). The relevant MIME for the CC is "application/zip/*"
By the way: the zipped file must first be copied to DirInternals before the archiver is called to unzip. The archiver cannot handle the CC result.
 
Last edited:
Upvote 0
Top