Does anyone know how to get the android device system log programatically using Java? This would be something similar to what is available on lower panel on the Dalvik Debug Monitor.
Thanks in advance.
Does anyone know how to get the android device system log programatically using Java? This would be something similar to what is available on lower panel on the Dalvik Debug Monitor.
Thanks in advance.
does this help?
http://developer.android.com/reference/android/util/Log.html
Untested with 'adb shell logcat', but I've used this to get other things from via adb:
public static String[] getAdbLogCat() {
try {
Process p = Runtime.getRuntime().exec("/path/to/adb shell logcat");
InputStream is = p.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
final StringBuffer output = new StringBuffer();
String line;
ArrayList<String> arrList = new ArrayList<String>();
while ((line = br.readLine()) != null) {
System.out.println(line);
}
return (String[])arrList.toArray(new String[0]);
} catch (IOException e) {
System.err.println(e);
e.printStackTrace();
return new String[]{};
}
}