3

I created a database in Android using below line of code-

SQLiteDatabase sampleDB = this.openOrCreateDatabase("SAMPLE_DB_NAME", MODE_PRIVATE, null);

Now, i want to know what would be the Uri for this database or how to find the Uri of the created database.Please help me out.

Thanks in Advance Manoj

  • Please refer to the following SO question: http://stackoverflow.com/questions/1465122/in-android-sdk1-5-where-do-i-find-my-sqlite-db-in-my-system – punnie Feb 04 '11 at 13:02

1 Answers1

0

content://com.package_name.dbprovider_name/table_name

you have implement following code

File dbFile = this.getDatabasePath(DB_NAME);
  for (File f:files) 
   {
        if (f.isDirector) 
                 searchFile(f);
        else if (f.getName().equals("accounts.db")) 
        {
            // delete db here...
            // and exit the search here...
        }
 }

if it contains the accounds.db. If you reach another subdirectory, call your own function recursively with the subfolder as the starting point,

Parag Ghetiya
  • 421
  • 2
  • 14