I have an application available on the Android Market. Some users have asked for a debugging method when everything is not working as expected. I studied adding a menu item in which the output will be displayed
Process mLogcatProc = null; BufferedReader reader = null; mLogcatProc = Runtime.getRuntime().exec( new String[] {"logcat", "-d", "AndroidRuntime:E BDtN:V *:S" }); reader = new BufferedReader(new InputStreamReader (mLogcatProc.getInputStream())); String line; ArrayList listOfLogLines = new ArrayList(); while ((line = reader.readLine()) != null) { listOfLogLines.add(line); }
I mainly extract parts of the log lines. * that my application wrote, and the errors that AndroidRuntime launched.
I have a working prototype that will display to the user the contents of the log part that I extracted in the ListView.
I will need to add android.permission.READ_LOGS to the AndroidManifest.xml file so that my application has read access to the log, and this, of course, will be the information that the user will request before installation. And the question is, is this considered impolite, dangerous, or otherwise unusual. Does the user hold the installation?
android logging
Jbruntt
source share