importar / exportar a la base de datos sqlite de Android

He visto algunas publicaciones sobre cómo importar y exportar una base de datos en Android y encontré este código, pero parece que no puedo hacer que funcione. Recibo el error java.io.filenotfoundexception / storage / sdcard0 / BackupFolder / DatabaseName: error de abrir ENOENT (no existe dicho archivo o directorio). He cambiado algunas cosas pero todavía no se encuentra el archivo de excepción

Aquí está mi exportación:

private void exportDB() {
        try {
             db.open();
             File newFile = new File("/sdcard/myexport");
            InputStream input = new FileInputStream(
            "/data/data/com.example.mycarfuel/data

bases/MyDatabase");

                OutputStream output = new FileOutputStream(newFile);
                byte[] buffer = new byte[1024];
                int length;
                while ((length = input.read(buffer)) > 0) {
                    output.write(buffer, 0, length);
                }
                output.flush();
                output.close();
                input.close();
                db.close();

            } catch (FileNotFoundException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
}

y mi importación:

private void importDB() {
        try {
            File sd = Environment.getExternalStorageDirectory();
            File data = Environment.getDataDirectory();

            if (sd.canWrite()) {
                String currentDBPath = "//data//" + "PackageName"
                        + "//databases//" + "DatabaseName";
                    String backupDBPath = "/BackupFolder/DatabaseName

";
                File backupDB = new File(data, currentDBPath);
                File currentDB = new File(sd, backupDBPath);

                FileChannel src = new FileInputStream(currentDB).getChannel();
                FileChannel dst = new FileOutputStream(backupDB).getChannel();
                dst.transferFrom(src, 0, src.size());
                src.close();
                dst.close();
                Toast.makeText(getBaseContext(), backupDB.toString(),


Toast.LENGTH_LONG).show();
        }
    } catch (Exception e) {
        Toast.makeText(getBaseContext(), e.toString(), Toast.LENGTH_LONG)
                .show();
    }
}

Respuestas a la pregunta(2)

Su respuesta a la pregunta