Third option. I guess that you logged the file content. Log truncates messages longer than 4000 characters. TextWriter or File.WriteString will never truncate anything. If there isn't enough memory (and there is) then there will be an error.Is this an Android limit, or TextWriter, or what?
How are you joining your strings?Id have to join a lot of strings, and that takes a very long time when debugging.
Tip: don't use TextWriter. Use File.WriteString or WriteList.
Not very likely as this is a very stable API. If you can reproduce it in a small project then please do.but I suspect a bug in TextWriter.
I was using s = s & <newvalue>
I've switched to Writelist and that seems to work (instead of writing line by line, I now add to a list then dump the lot) , but I suspect a bug in TextWriter.
If you are writing a logs file then open it with File.OpenOutput with Append = True. Write the string. You can do it with OutputStream.Write.
Public Sub LogToFile (msg As String)
Dim out As OutputStream = File.OpenOutput(xui.DefaultFolder, "log.txt", True)
'you might want to add: msg = msg & CRLF
Dim b() As Byte = msg.GetBytes("UTF8")
out.WriteBytes(b, 0, b.Length)
out.Close
End Sub
Everything needed is available:
B4X:Public Sub LogToFile (msg As String) Dim out As OutputStream = File.OpenOutput(xui.DefaultFolder, "log.txt", True) 'you might want to add: msg = msg & CRLF Dim b() As Byte = msg.GetBytes("UTF8") out.WriteBytes(b, 0, b.Length) out.Close End Sub