Android

write to a sdcard file

tomato13 2012. 5. 15. 11:21

public static void FileWriterInit()

{

try

{

File sdCard = Environment.getExternalStorageDirectory();

File dir = new File(sdCard.getAbsolutePath() + "/webprefetch");

dir.mkdirs();

File file = new File(dir, mFileName);

mFos = new FileOutputStream(file);

} catch (Exception e)

{

android.util.Log.d("Debug", e.getMessage());

}

}


public static void FileWriteClose()

{

try

{

mFos.close();

} catch (Exception e)

{

android.util.Log.d("Debug", e.getMessage());

}

}


        public static void FileWrite()

        {

                 mFos.write(a_str.getBytes());

        }


'Android' 카테고리의 다른 글

AsyncTask  (0) 2012.07.17
Install another apk manually in source code  (0) 2012.07.16
Disable highlighting in GridView  (0) 2012.04.16
WebView 한글깨짐  (0) 2012.04.04
VideoView의 Controller를 Custom으로 등록  (0) 2012.04.03