I'm having a problem with the internal path to export the database. The Log says it is the wrong path.
File sd = Environment.getExternalStorageDirectory();
File data = Environment.getDataDirectory();
FileChannel source=null;
FileChannel destination=null;
String cartella = (getString(R.string.app_name));
String currentDBPath = "/data/"+getPackageName()+"/cartella/"+"Backup.db";
String backupDBPath = "/cartella/Backup.db";
File currentDB = new File(data, currentDBPath);
File backupDB = new File(sd, backupDBPath);
try {
source = new FileInputStream(currentDB).getChannel();
destination = new FileOutputStream(backupDB).getChannel();
destination.transferFrom(source, 0, source.size());
source.close();
destination.close();
Toast.makeText(this, "DB Exported!", Toast.LENGTH_LONG).show();
} catch(IOException e) {
e.printStackTrace();
Toast toast = Toast.makeText(getApplicationContext(),(R.string.Toast_export_errore), Toast.LENGTH_SHORT);
toast.show();
Log
01-20 08:55:14.757: W/System.err(1383): java.io.FileNotFoundException: /data/data/info.androidhive.slidingmenu/cartella/Backup.db: open failed: ENOENT (No such file or directory)
01-20 08:55:14.787: W/System.err(1383): at libcore.io.IoBridge.open(IoBridge.java:409) 01-20 08:55:14.787: W/System.err(1383): at java.io.FileInputStream.(FileInputStream.java:78) 01-20 08:55:14.827: W/System.err(1383): at main.Impostazioni.Esporta(Impostazioni.java:334) 01-20 08:55:14.827: W/System.err(1383): at java.lang.reflect.Method.invokeNative(Native Method) 01-20 08:55:14.827: W/System.err(1383): at java.lang.reflect.Method.invoke(Method.java:525) 01-20 08:55:14.827: W/System.err(1383): at android.view.View$1.onClick(View.java:3628) 01-20 08:55:14.857: W/System.err(1383): at android.view.View.performClick(View.java:4240) 01-20 08:55:14.857: W/System.err(1383): at android.view.View$PerformClick.run(View.java:17721) 01-20 08:55:14.877: W/System.err(1383): at android.os.Handler.handleCallback(Handler.java:730) 01-20 08:55:14.877: W/System.err(1383): at android.os.Handler.dispatchMessage(Handler.java:92) 01-20 08:55:14.887: W/System.err(1383): at android.os.Looper.loop(Looper.java:137) 01-20 08:55:14.898: W/System.err(1383): at android.app.ActivityThread.main(ActivityThread.java:5103) 01-20 08:55:14.927: W/System.err(1383): at java.lang.reflect.Method.invokeNative(Native Method) 01-20 08:55:14.927: W/System.err(1383): at java.lang.reflect.Method.invoke(Method.java:525) 01-20 08:55:14.957: W/System.err(1383): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 01-20 08:55:14.957: W/System.err(1383): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 01-20 08:55:14.987: W/System.err(1383): at dalvik.system.NativeStart.main(Native Method) 01-20 08:55:14.987: W/System.err(1383): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)