Android Question Save and SaveAs

In this thread:


The SaveAs Sub works correctly, but when the user has used OpenWith or load, there is a path and there is no need for SaveAs and it must be saved directly. how must I make save Sub from existing path without using content resolver. Thanks.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is the relevant line of code:
B4X:
Dim out As OutputStream = ctxt.InitializeContext.RunMethodJO("getContentResolver", Null).RunMethod("openOutputStream", Array(jo.RunMethod("getData", Null)))
You need to keep the return value of jo.RunMethod("getData", Null). You can later try to use it again. Note that there is no guarantee that it will work. It depends on the external app that actually manages the url. You don't have direct access to the file system.

Another option is to use ExternalStorage. Once the user chose a folder, you can access it without asking for another approval (in most cases).
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0
Storge library does not have a practical example project, if you could create a project like a text editor for Storge, it would be great.
In addition, I want to have both save and storage sample.
 
Upvote 0
Top