是。这是我使用的功能:
public void copyDBToSDCard() { try { InputStream myInput = new FileInputStream("/data/data/com.myproject/databases/"+DATAbase_NAME); File file = new File(Environment.getExternalStorageDirectory().getPath()+"/"+DATAbase_NAME); if (!file.exists()){ try { file.createNewFile(); } catch (IOException e) { Log.i("FO","File creation failed for " + file); } } OutputStream myOutput = new FileOutputStream(Environment.getExternalStorageDirectory().getPath()+"/"+DATAbase_NAME); byte[] buffer = new byte[1024]; int length; while ((length = myInput.read(buffer))>0){ myOutput.write(buffer, 0, length); } //Close the streams myOutput.flush(); myOutput.close(); myInput.close(); Log.i("FO","copied"); } catch (Exception e) { Log.i("FO","exception="+e); }}对于我从事的项目,我在主屏幕上放置了一个菜单选项,可以随时调用此功能。然后,将数据库移到桌面上,并使用FireFox的SQLiteManager插件打开它。



