Hello to all,
I am new here so please forgive any mistakes.
I am trying to create a small example which would read the Phone's internal log and insert each line into a listview.
As i studied the Phone Library documentation, i think i could use LogCat Member with LogCatStart and LogCatStop to read any log.
Unfortunately this does not happen. Maybe i have misunderstood something ?
Here is an example:
Global Declaration
The LogCatStart call
The LogCatData Event
The LogCatStop call
The LogCatData Event is never fired. I also tried to pass some command arguments into LogCatStart according with the documentation, but nothing happened.
Thank you.
I am new here so please forgive any mistakes.
I am trying to create a small example which would read the Phone's internal log and insert each line into a listview.
As i studied the Phone Library documentation, i think i could use LogCat Member with LogCatStart and LogCatStop to read any log.
Unfortunately this does not happen. Maybe i have misunderstood something ?
Here is an example:
Global Declaration
B4X:
Sub Process_Globals
Dim Logger As LogCat
Dim Args(1) As String
End Sub
The LogCatStart call
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
Logger.LogCatStart(Args,"LogCatData")
End Sub
The LogCatData Event
B4X:
Sub LogCatData(Buffer() As Byte, Length As Int)
Dim data As String
data = BytesToString(Buffer,0,Length,"UTF-8")
ListViewLogData.AddSingleLine(data)
Log(data)
End Sub
The LogCatStop call
B4X:
Sub ButtonStop_Click
Logger.LogCatStop()
ExitApplication
End Sub
The LogCatData Event is never fired. I also tried to pass some command arguments into LogCatStart according with the documentation, but nothing happened.
Thank you.