Back to project page Calma.
The source code is released under:
Apache License
If you think the Android project Calma listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.stericson.RootTools.execution; // w w w.j a v a 2s .com import android.content.Context; import com.stericson.RootTools.RootTools; public class JavaCommandCapture extends Command { private StringBuilder sb = new StringBuilder(); public JavaCommandCapture(int id, Context context, String... command) { super(id, true, context, command); } public JavaCommandCapture(int id, boolean handlerEnabled, Context context, String... command) { super(id, handlerEnabled, true, context, command); } public JavaCommandCapture(int id, int timeout, Context context, String... command) { super(id, timeout, true, context, command); } @Override public void commandOutput(int id, String line) { sb.append(line).append('\n'); RootTools.log("Command", "ID: " + id + ", " + line); } @Override public void commandTerminated(int id, String reason) { // pass } @Override public void commandCompleted(int id, int exitCode) { // pass } @Override public String toString() { return sb.toString(); } }