File operation in Android

Quickly share your Android Code Snippets here...

File operation in Android

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

Hi,
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..

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

Top

Return to Code Snippets for Android

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests