I am trying to print the last 200 or so lines from Android Logcat in my app.
So far I have been able to get Logcat into a BufferedReader using InputStreamReader. The problem is I don’t know how to to jump to the end of the buffered Reader and then read backwards, Or jump to a just above the last 200 lines and print from there.
I don’t want to do the brute force method where I read the whole log. I am hoping there is a more elegant solution.
Thanks.
So this isn’t the solution I was looking for but does what I wanted. Instead of bringing the log into a BufferedReader and then sorting it out and printing it. I use logcat tags to specific the size of an output file.
And then reading back the file.