Download source code of this article.

Here is a sample application to view logcat messages on device. The application runs the command “logcat” using Runtime class, reads each log string and adds the string to a list view. Whenever you click on an item, an alert box is displayed with the corresponding log message.