began to redo the code so that we use Android techniques for creating
input and output streams. This should hopefully lead to fewer bugs.