1

Hello everyone i am using db in my app i have stored that db in assets folder here is the sample where i have set my db path.Its not generating any folder of db in the package. Can anyone help me out here..

public class Paths 
            {
                private static final String FILEPATH = Environment.getExternalStorageDirectory() + "/Nali Kali/";
                private static final String DBPATH = "data/data/com.android.akshara/databases/";
                private static final String DBNAME = "akshara.db";

                public Paths()
                {

                }
                public static String getFilePath()
                {

                    return FILEPATH;
                }
                public static String getDbPath()
                {
                    return DBPATH;
                }

                public static String getDbName()
                {
                    return DBNAME;
                }
        }


    Thank you in advance.:-)
Rithesh M
  • 1,287
  • 1
  • 12
  • 23
  • try this http://stackoverflow.com/questions/513084/how-to-ship-an-android-application-with-a-database – Ajay Apr 02 '12 at 11:08
  • Complete example is here http://stackoverflow.com/questions/9109438/using-already-created-database-with-android/9109728#9109728 – Yaqub Ahmad Apr 02 '12 at 12:42

1 Answers1

1

The complete example of how to do it? is here.

1- Keep the Database in assets folder.

2- Copy the database from assests to data folder.

3- Write a DataAdapter class for common functions like insert/update/delete.

Community
  • 1
  • 1
Yaqub Ahmad
  • 27,569
  • 23
  • 102
  • 149
  • the problem is that in file explorer under the package which i created there is only one folder _lib_ no _database_ folder no the db file which i created!!!!! – Rithesh M Apr 03 '12 at 09:34