How to use Pre populated Database with the real device
I have made my database using greendao and Have been testing it on the emulator so far. It was working so perfectly. And there was no memory leak and any error whatsoever .
But now I am stuck to just one single point. and that is how do I use this pre-populated database in the application on the real device. How can I push my database into real device?
Some one suggest me to put my database file in the assets folder and later on Application start just copy it into device.
The suggestion was good, but it is not helping me as there comes the error when I run my application for the first time , but after that it goes forward But then greendao is unable to get the database it find.
The error I got at first run is as under. can not open database
Buton second run it goes forward and there in next activity I am getting data in list using greendao , but it is not finding that database.
Please tell me : 1) How can I push my pre papulated database into the device to be use by greendao methods.
2) What is a way that is supported in all devices.
Please share me the code. Its been a long I am trying to get over this. But nothing is helping me out.
I made a simple dictionary demo for Android, which manipulates prebuilt database in assets
folder with GreenDAO 3.x.
All you have to do is extended the DevOpenHelper
class that GreenDAO generates.
Here is the project link: Sawloih.
链接地址: http://www.djcxy.com/p/74586.html上一篇: Android按钮具有不同的背景颜色
下一篇: 如何使用预填充数据库与真实设备