File operation in Android

Quickly share your Android Code Snippets here...

File operation in Android

Postby dkumar » Mon Mar 15, 2010 6:23 pm

I am new to Android development. I was wondering how the file operations works in Android. As in J2ME it has FileConnection class that takes care of most of the File operation tasks.. and it FileConnection doesn't support Android, what is the best way to accomplish the File Operation tasks? I would appreciate if someone could send me some code snippet: Thanks..

Tasks I want to do :

1) Create a Directory( check for its existence first, if not then create it)
2) Create a File in the newly created Directory
3) Write data into the file
4) Read from the file
5) Delete the file

I want to create the file in Built-in memory or SDCard.. so for this, how do I specify the PATH.?

I found the classes File, FileWriter, FileReader in the SDK.. but am not finding any samples..

Thanks for your help in advance..

Once Poster
Once Poster
Posts: 1
Joined: Mon Mar 15, 2010 5:40 pm


Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 1 guest