java - Writing on SDCard Problem - Android -


i'm trying write file sdcard in htc hero phone. create file in sdcard using:

file = new file(path.getabsolutepath(), "filename.txt");

where path path externalstoragedirectory (i.e. \sdcard)

when log path of file, \sdcard\filename.txt

however, when create fileoutputstream write file, filepath changed \data\data , cannot access it.

can please clarify how can create file in sdcard , write it?

thanks!

edit:

path = environment.getexternalstoragedirectory(); log.d("sdcardplswork", path.tostring());     try     {         myfile = new file(path.getabsolutepath(), "sensorvalues.txt");         boolean = myfile.createnewfile();         log.d("sdcardplswork", myfile.tostring() + " " + i);         fos = new fileoutputstream(myfile);         log.d("fileandroid", getfilestreampath("sensorvalues.txt").tostring());     }      catch(filenotfoundexception e)     {         e.printstacktrace();     } 

this i'm doing. part until sdcardplswork correct, when comes fileandroid log goes private data storage.

getfilestreampath(..) reads local directory. debug code wrong.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -