How do you create a new file using file picker and write to it?

You could try with the SAF extension?

See HERE, scroll to Section 4 (Working with Text/CSV files in Shared Directories) of the guide.

Should work with all android versions.

Since I would like to keep it open to be available for iOS, I would like to stay away from extensions for the moment (although I do use the BLE extension to communicate with a microcontroller in the hope that at some point it will not be a problem for iOS either).

Is this a bug? I could not so far figure out a universal way of getting the file name and path out of the uri, it would be good to be able to write to a file where the user can look for the path, even if it is in a restricted location.