Phone.LogCat is very short on examples. I am trying to capture 5,000 characters in a round robin. In this way, at any moment I can capture recent LOGCAT from devices running the software in the field.
From a module named Globals:
I have added this with the Manifest Editor:
my logcat_LogCatData routine is apparently never called.
I have experimented with Args...
"-v long"
"-v"
neither affect non-execution of the event.
From a module named Globals:
B4X:
Sub Process_Globals
...
Private logcat As LogCat
Private logString As StringBuilder
End Sub
Public Sub Init
...
logString.Initialize
logcat.LogCatStart(Array As String(),"logcat")
End Sub
Sub logcat_LogCatData(Buffer() As Byte, Length As Int)
Dim data As String
data = BytesToString(Buffer,0,Length,"UTF-8")
logString.Append(data)
If logString.Length > 5000 Then
logString.Remove(0,logString.Length-5000)
End If
End Sub
I have added this with the Manifest Editor:
B4X:
AddPermission(android.permission.READ_LOGS)
my logcat_LogCatData routine is apparently never called.
I have experimented with Args...
"-v long"
"-v"
neither affect non-execution of the event.