When I learned to program in Java, I used a lot of standard input and output (stdin and stdout). Now that I am curious to learn what I can do on Android, I wanted to know if for practicality I can do the same thing I did on the Java SE platform, which is: create a "console" application.
With a console application we can do some very practical things like:
Direct the output of the program to other Unix utilities (on Android requires Busybox).
am start -n com.example.android/.MainActivity | sort -u | sed ... > saída.txt
Or direct the output of other programs to my program's default input.
logcat|am start -n com.example.android/.MainActivity
I got to try out the Jackpal Terminal Emulator and I noticed that it uses these features:
Android absolutely supports pipes as well as unix domain sockets. Use of exec is somewhat discouraged, but works at the moment.
See the source of any android terminal emulator with a local shell an example of how to do it. Essentially your gui just replaces the terminal emulator, and your engine replaces the shell. Chris Stratton