안녕하세요 안드로이드에 입문한지 2주된 초보입니다..
제가현재 sd카드 백업 및 복구에 대해서 공부중인데요 ...
try {
File sd = Environment.getExternalStorageDirectory();
File data = Environment.getDataDirectory();
if (sd.canWrite()) {
String currentDBPath = " ";
String backupDBPath = " ";
File currentDB = new File(data, currentDBPath);
File backupDB = new File(sd, backupDBPath);
FileInputStream fis = new FileInputStream(backupDB);
FileOutputStream fos = new FileOutputStream(currentDB);
FileChannel src = fis.getChannel();
FileChannel dst = fos.getChannel();
dst.transferFrom(src, 0, src.size());
src.close();
dst.close();
fis.close();
fos.close();
Toast.makeText(getBaseContext(), "DB파일을 불러왔습니다.",
Toast.LENGTH_LONG).show();
외국사이트에서 이 소스를구했는데 실행은 되는데
개념을 이해하지못햇습니다.. 혹시 주석좀 달아주실분 계신가요..