J John.Reacher Member Nov 19, 2022 #1 In this thread: SaveAs - Let the user select a target folder + list of other related methods B4A + B4i example: https://www.b4x.com/android/forum/threads/b4x-texteditor-save-and-load-external-files.132731/#post-838166 List of classes or libraries that can be used to access secondary storages: ContentChooser (Phone libray) - allows the user to select a resource or file using external... www.b4x.com 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.
In this thread: SaveAs - Let the user select a target folder + list of other related methods B4A + B4i example: https://www.b4x.com/android/forum/threads/b4x-texteditor-save-and-load-external-files.132731/#post-838166 List of classes or libraries that can be used to access secondary storages: ContentChooser (Phone libray) - allows the user to select a resource or file using external... www.b4x.com 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 Nov 20, 2022 #2 This is the relevant line of code: Code: 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
This is the relevant line of code: Code: 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).
J John.Reacher Member Nov 20, 2022 #3 What is that and how do I use it? I am new to b4x. Could you please give me save sub Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 21, 2022 #4 ExternalStorage - Access SD cards and USB sticks Before we start: External storage means a real sd card or a connected mass storage USB device. This class can also be used to access the secondary storage (File.DirRootExternal). This becomes relevant with newer versions of Android that restrict direct access. It has nothing to do with runtime... www.b4x.com Upvote 0
ExternalStorage - Access SD cards and USB sticks Before we start: External storage means a real sd card or a connected mass storage USB device. This class can also be used to access the secondary storage (File.DirRootExternal). This becomes relevant with newer versions of Android that restrict direct access. It has nothing to do with runtime... www.b4x.com
J John.Reacher Member Nov 21, 2022 #5 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
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.