File.
WriteString (Dir As String, FileName As String, Text As String)
Writes the given text to a new file.
Example:
File.WriteString(File.DirRootExternal, "1.txt", "Some text")
B4J Question losing character when using File.WriteString - ArmedEmperor977 (first post)    
Feb 10, 2022
The backslash indicates that the next character should treated "as is" (not as a special ...
link: The backslash indicates that the next character should treated "as is" (not as a special c...
link: string to JSON tree online with Erel's tool at https://www.b4x.com/android/forum/threads...
link: "\" next to the 1. In the code, I am using this command:
File.WriteString(File.DirApp...
B4A Code Snippet SaveAs - Let the user select a target folder + list of other related methods - Erel    
Sep 10, 2023   
(43 reactions), Null)
End Sub
Usage example:
Private Sub Button1_Click
File.WriteString(File.DirInternal...", Null), "wt")) 'wt = Write+Trim
File.Copy2(Source, out)
out.Close...-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... a folder, your app can read and write from that folder. Doesn't require any permission.
Not all...
B4J Question Problem with File.WriteString i File.ReadString - Zlgo (first post)    
Mar 3, 2020() As String)
Dim bb As B4XBytesBuilder
bb.Initialize
bb.Append(File.ReadBytes(File...("ascii"), ("" & DateTime.Now).GetBytes("ascii"))
File.WriteBytes...
link: () As String)
Dim bb As B4XBytesBuilder
bb.Initialize
bb.Append(File.ReadBytes(File...
link: ) and againt to byte. Finishing saving to new file "ispis.prn" with help File.WriteBytes. For...
link: File.WriteString?...
B4A Library [B4X] CSVParser - CSV parser and generator - Erel    
Jun 29, 2020   
(33 reactions)   
tags: parser, csv CSV strings:
Dim parser As CSVParser
parser.Initialize
Dim table As List = parser.Parse(File.ReadString(File.DirAssets, "1.csv"), ",", False)
For Each row() As String In table
'work with row
Next
Dim s As String = parser.GenerateString(table, ",")
File.WriteString(File.DirApp, "1.csv", s)
...CSV - comma separated values format.
The various StringUtils libraries include methods for loading...
B4A Question Problem File.WriteString - Permission denied - DonManfred (first post)    
Mar 29, 2019You can find an Example code here:
https://www.b4x.com/android/forum/threads/copy-a-file-from-internal-memory-to-sd-card.102705/
NOTE that it is a quite complicated Framework....
link: must I select my file to copy to USB-Stick first manually in Listview (with ExternalStorage Class...
link: Yes, I using TargetSDK 26, 27 , 28
must I select my file to copy to USB-Stick first manually in...
link: Are you using TargetSDK 26 in your App?
TargetSDK 26 is recommended to use in your Manifest. Google ...
B4J Code Snippet Test if process is running as administrator on Windows - Erel    
Feb 14, 2024   
(9 reactions)
Private Sub IsRunningAsAdmin As Boolean
Try
Dim f As String = GetEnvironmentVariable("SYSTEMDRIVE", "") & "\isadmin.txt"
File.WriteString(f, "", "test")
File.Delete(f, "")
Return True
Catch
Return False
End Try
End Sub
A bit hacky but should work. Windows only....
B4A Question File.Readstring & File.Writestring - Fabri    
Aug 22, 2017 but if position doesn't exist the complier return me an error
Value1 = File.ReadString(File.DirInternal, "Text")
Value2 = File.ReadString(File.DirInternal, "Text2"...
link: we just can fish. I dont like fishing.
Is it possible initialize to read information before write...
link: Thank you....
link: You can use MakeDir, if the folder already exists it does nothing....
B4A Question File.WriteString Problem - Cableguy (first post)    
Mar 14, 2016   
(1 reaction)
I see in the documentation that DirRootExternal, DirInternal and DirDefaultExternal are labeled as ...
link: No. It is not related to B4A. The file system is read-only for some reason.
The best solution...
link: (published), contains all of the following lines which work as intended:
File.WriteString(File...
link: related to B4A. The file system is read-only for some reason.
The best solution is to avoid using...
B4A Tutorial Android Device Unique ID - Alternative to PhoneId - Erel    
Jun 10, 2020   
(8 reactions)   
tags: SDK, "SDK_INT")
If Api < 9 Then
'Old device
If File.Exists(File.DirInternal, "__id") Then
Return File.ReadString(File.DirInternal, "__id")
Else
Dim id As Int
id = Rnd(0x10000000, 0x7FFFFFFF)
File.WriteString(File... Activity_Create(FirstTime As Boolean)
Log(GetDeviceId)
End Sub
Sub GetDeviceId As String
Dim r...
B4A Question To File.WriteString or Not to File.WriteString that is the question - klaus (first post)    
Jun 22, 2011Have a look here, post #1, for more explanations.
Best regards....
link: Hello Shane,
I think DirAssets is read only. You need to write to another location....
link: = txtSayings.text
End Sub
Sub btnSave_Click
File.WriteString (File.DirAssets...
Page: 1  
2  
3  
4  
5  
6  
7