-1

In my Android application I want to export my database. But I am not getting the file. Please check the code below.

File data = Environment.getDataDirectory();
 String  currentDBPath= "/data" +"/data/"+ "com.edsys.eyfs"
                       + "/databases/" + "EdsysEyfsDB";
               Log.d("current path of db", currentDBPath.toString());


File currentDB = new File(data, currentDBPath);
               Log.d("backup database", currentDB.toString());

I am checking in android emulator. I am not getting any message on "backup database" log. Please help me to find solution for this

Cœur
  • 34,719
  • 24
  • 185
  • 251
Ameer
  • 2,677
  • 1
  • 26
  • 42
  • Your question is not very clear. What exactly are you asking. Also, you can retrieve the full database path with *File db= context.getDatabasePath("Databasename.db");* – Kuffs Sep 30 '13 at 08:07
  • Take a look at http://stackoverflow.com/a/6542214/2065418. Explain how to import/export database. – Damien R. Sep 30 '13 at 08:08

1 Answers1

0

get the db path like that

File dbFile=getDatabasePath("database.db");
 Log.v(TAG, "Db path is: "+dbFile)
Sunil Kumar
  • 7,083
  • 4
  • 31
  • 50