Hi everyone!
What are the folders in Android where I can write without permissions?
For example, if I want to save a settings file, where do I save it?
I tried with “SpecialFolder.Resources” but the app hangs and no longer responds.
The line: Var f As FolderItem = SpecialFolder.Resources.Child("data.txt")
I don’t do anything else at the moment. I don’t read, I don’t write, nothing. Only this line and the app no longer responds.
I think that all specialFolders of the type Documents, ApplicationSupport, etc., all correspond to the App’s data folder on Android, where perennial data can be saved, but this remains to be verified.
dataDir is the path to the application’s data directory on the file system. This directory is application-specific and is used to store the application’s persistent data files, such as SQLite databases, shared preferences and application-specific files. The contents of this directory are accessible only to your application, ensuring a measure of security and confidentiality.
The typical path is /data/data/<package_name>, where <package_name> is the package name of your application.
Xojo SpecialFolder / FolderItem Classes are currently undocumented / sub documented for iOS and Android (or maybe with some problem of visibility, finding)
SpecialFolder, for example, there are columns for Windows, macOS and Linux only.
Resources, paths and use cases are not clear for those platforms.
We do document in the Notes section what those each mean on Mobile. Their actual locations in the file system are irrelevant since you can’t access them any way except via SpecialFolder.
Current working directory (depends on the location of the application). When run from Xojo, it is the path to Xojo. In a built app, it is the path to the built app.
Current working directory (depends on the location of the application). Usually /.
GetFromDomainAndCode (domain as Integer, fourCharCode as String)
Raises PlatformNotSupportedException
Pass a class constant for the domain and a four-character code of a specific FolderItem. The constants are: DomainSystem (currently folders inside ‘/System’), DomainLocal (currently folders inside ‘/Library’), DomainUser (currently folders inside the user’s home folder)
\Users\UserName\AppData\Roaming|/Users/UserName/Library/Preferences - On macOS, use SpecialFolder.ApplicationData to save your own files or directly call CFPreferences to save preferences files here.
That’s not a property list. It is a lost note floating somewhere in the page.
The class start with a list of values and OS columns, I missed iOS and Android and lots of N/A where it does not fit
If you want to separate Desktop, Mobile and Web, follow the same design, with sessions on the page, and a clear header “Desktop” for the first table, Mobile for the second and Web for the 3rd. One after the other.
On the top, in the first explanations about the class, explain the differences and list the hyperlinks to the sessions of each platform.
Extra notes comes after the tables on each session.
There don’t seem to many places where you can save a file and access with other Apps later on.
However, if you save to SpecialFolder.ExternalStorage.Child(“data.txt”), you can access the file from a PC with the Android device connected via USB for file transfer.
What I would like to do is to create a file in the phone’s Downloads folder. This doesn’t appear to be possible without 3rd-party API classes.