我有一个将数据存储在应用程序数据库中的应用程序...我编写了代码以将应用程序数据发送到在模拟器中创建的 sdcard...数据文件已传输到 sd 卡,我可以在 eclipse 中查看...但是我如何在模拟器中看到该文件??它保存在哪里?
我用来转移的代码如下
try
{
File sd = Environment.getExternalStorageDirectory();
File data = Environment.getDataDirectory();
if (sd.canWrite())
{
String currentDBPath = "\\data\\sharath.android.trail\\databases\\griet1";
String backupDBPath = "sdcard_db";
File currentDB = new File(data, currentDBPath);
File backupDB = new File(sd, backupDBPath);
if (currentDB.exists()) {
FileChannel src = new FileInputStream(currentDB).getChannel();
FileChannel dst = new FileOutputStream(backupDB).getChannel();
dst.transferFrom(src, 0, src.size());
src.close();
dst.close();
}
boolean bool=true;
if(bool == true)
{
Toast.makeText(Trial1Activity.this, "Backup Complete", Toast.LENGTH_SHORT).show();
bool = false;
}
}
}
catch (Exception e) {
Log.w("Settings Backup", e);
}
}
提前致谢