Android examples for File Input Output:Binary File
write UUID to a File with FileOutputStream
//package com.java2s; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.UUID; public class Main { private static void writeInstallationFile(File installation) throws IOException { FileOutputStream out = new FileOutputStream(installation); String id = UUID.randomUUID().toString(); out.write(id.getBytes());/*from w w w. j a v a 2 s . co m*/ out.close(); } }