I export my application to .apk file, sign it then install it. But when I run my App, it displays an error because there's no data in my database. The database was created as a new one when I installed the application, so all the data were lost! How can I include database data when exporting an Android application? I check it an eclipse DDMS File explorer.the database does not have a any tables. it's copying database partily in my asset folder.
Asked
Active
Viewed 809 times
1
-
1Look at http://stackoverflow.com/questions/513084/how-to-ship-an-android-application-with-a-database – user370305 Jul 21 '12 at 11:16
1 Answers
1
For that you have to keep copy of your database in asset
folder and copy your database when your application get installed at first time
See this code for How to copy your database
Hope this will help you...
-
i copy and paste a database in my asset folder. but not full db store in emulator device. i check it in DDMS device file explorer – Palaniraja Jul 21 '12 at 11:20
-
4.00kb. in my code i copide the dp from asset folder and stored in data/data/mypackage/database folder.and run it.in finally coping 3kb only device – Palaniraja Jul 21 '12 at 11:27
-
i create a table using sqllitemanager gui tool..sqllite version 3.it's have any issue – Palaniraja Jul 21 '12 at 11:32