Skip to content Skip to sidebar Skip to footer

Viewing Logcat In Tablet

Is there a way to view the log on a tablet running 4.4? I've downloaded several apps like aLogCat and none of them show what my app writes out with S.o.p or Log.d. I have an inte

Solution 1:

You're focussing on tring to read out logcat, but there are better solutions for reading crash logs. My personal preference is Crashlytics, which automatically logs fatal exceptions and provides mechanisms for logging other messages.

The way all these crash reporters work, is by defining a UncaughtExceptionHandler:

Thread.setDefaultUncaughtExceptionHandler(
            newMyUncaughtExceptionHandler(this));

If you prefer to use your own solution, you may want to look into using this. See this related question for more details.

Solution 2:

Is there a way to view the log on a tablet running 4.4?

No, sorry. An app can only see its own log messages, not those from other apps. Hence, a third-party log viewer cannot see your app's messages.

Is there any way to view the log after this event without having to connect to a PC and use the adb program?

Use any standard crash management library, like ACRA, or services like Crashlytics, BugSense, etc.

Solution 3:

The AIDE Application (Android Integrated Development Environment) allows one to develop android Apps directly on android device.

One particular feature is to read the logcat.

You can get it here https://play.google.com/store/apps/details?id=com.aide.ui

Solution 4:

Here's the code I've put in the program. It seems to work:

// Define inner class to handle exceptionsclassMyExceptionHandlerimplementsThread.UncaughtExceptionHandler{
        publicvoid uncaughtException(Thread t, Throwable e){
           java.util.Date dt =  new java.util.Date();
           Stringfn = LogFilePathPfx + "exception_" + sdf.format(dt) + ".txt";
           try{ 
              PrintStream ps = new PrintStream( fn );
              e.printStackTrace(ps);
              ps.close();
              System.out.println("wrote trace to " + fn);
              e.printStackTrace(); // capture here also???
              SaveStdOutput.stop(); // close here vs calling flush() in class 
           }catch(Exception x){
              x.printStackTrace();
           }
           lastUEH.uncaughtException(t, e); // call last one  Gives: "Unfortunately ... stopped" messagereturn;    //???? what to do here
        }
     }

     lastUEH = Thread.getDefaultUncaughtExceptionHandler(); // save previous one
     Thread.setDefaultUncaughtExceptionHandler(new MyExceptionHandler());

Post a Comment for "Viewing Logcat In Tablet"