Write file in sub-directory in Android

Posted by Davide Vosti on Stack Overflow See other posts from Stack Overflow or by Davide Vosti
Published on 2010-03-31T11:08:52Z Indexed on 2010/03/31 11:13 UTC
Read the original article Hit count: 159

Filed under:
|
|
|

I'm trying to save a file in a subdirectory in Android 1.5. I can successfully create a directory using

_context.GetFileStreamPath("foo").mkdir();

(_context is the Activity where I start the execution of saving the file) but then if I try to create a file in foo/ by

_context.GetFileStreamPath("foo/bar.txt");

I get a exception saying I can't have directory separator in a file name ("/").

I'm missing something of working with files in Android... I thought I could use the standard Java classes but they don't seem to work... I searched the Android documentation but I couldn't fine example and google is not helping me too...

I'm asking the wrong question (to google)...

Can you help me out with this?

Thank you!

© Stack Overflow or respective owner

Related posts about android

Related posts about file-io