2010-03-12

Piece of code to create a file in Android sdcard

byte[] byte_array = new byte[100];

File file = new File("sdcard/file_name.extension");

FileOutputStream fos = new FileOutputStream(file);

fos.write(byte_array);

            fos.flush();

            fos.close();

This code demonstrate how to make a file from a byte array, in the Android sdcard. You can create any kind of file using a regarding byte array.

1 comment:

Mobile Application Development said...

Nice post. Thanks for sharing nice information about mobile application development. Mobile Application Development is very useul and helpful in iPhone development and Android Mobile Application Development. Awesome post.