Need to determine if write permission is required before calling
The environment class provides a richer approach
|
Static File |
Getdatadirectory ()
Get the directory for Android data. |
|
Static File |
Getdownloadcachedirectory ()
Get the download cache directory. |
|
Static File |
getExternalStorageDirectory ()
Or an external storage media directory. |
|
Static File |
Getexternalstoragepublicdirectory (String type)
Get a top-level public external storage directory for placing files of a particular type. |
|
Static String |
Getexternalstoragestate ()
Gets the status of the current external storage media. |
|
Static File |
Getrootdirectory ()
Get a directory with Android. |
Public void Savesdcard (string filename, string filecontent) throws Exception { new File (environment.getexternalstoragedirectory (), filename); New fileoutputstream (file); Outstream.write (Filecontent.getbytes ()); Outstream.close (); }