1
我有一个应用程序,它将数据存储在应用程序数据库中...并且我编写了将应用程序数据发送到在仿真程序中创建的SD卡的代码...数据文件已被传输到SD卡,并且我可以在Eclipse中查看.. 。但我怎么能看到该文件在模拟器 ??它保存在哪里?如何查看存储在仿真器本身的SD卡中的数据?
这是我用来转院代码
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);
}
}
感谢低于事先
感谢乌拉圭回合回复访问它...我查询是如何去该文件在模拟器本身 – 2012-04-05 20:14:29
其实我有将保存在SD卡中的文件附加到邮件中......我必须在Android移动版中附加文件时如何获得该路径? – 2012-04-05 20:17:19
据我所知,仿真器上没有“File Explorer”应用程序。这将使得无法在仿真器本身上查看该文件,除非您安装了某个文件资源管理器或具有可打开它的应用程序。 – Jwc24678 2012-04-06 16:00:41