Android examples for java.io:PrintWriter
output Data in array to PrintWriter
import java.io.PrintWriter; import android.util.Log; public class Main { public static void outputData(short[] data, PrintWriter writer) { for (int i = 0; i < data.length; i++) { writer.println(String.valueOf(data[i])); }/* w ww.ja v a 2 s . c o m*/ if (writer.checkError()) { Log.w("", "Error writing sensor event data"); } } }