Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

push database to rooted device

 
Uchiha Kanda
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to access the data/ folder on my device I cant get it to open?..I've rooted my phone and I want to push my database to the database folder on my device so that I can run my developed app, it works fine on the emulator but I want to test it on a real device and its not getting the database.

I created my database with records using SQLite manager then I pushed it using DDMS on emulator. I tried inserting records using code but whenever the app starts it keeps inserting the same records is there a way to insert these record only once?

this is my insert code in DBHelper class:



and then I call it in my main class:



I've done a lot of searching but couldn't find any useful answers. Any help please, its very urgent.

Thanks
 
Chrobione Robinson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a link that I found describing close to what you are asking, but I saw some people at the bottom giving both positive and negative feedback.. hope the link helps...

http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/


In my own adventure of trying to push a database to the location was unsuccessful.
Instead I just ended up coding a class to handle the database build with all of my tables and initial values in code to make use of the oncreate() and database versioning android provides, for database upgrades.

My understanding of this is that andriod with the will check to see if the database is actually there, if not create.
Then when I change to db version 2 it will automatically with and a little extra coding. It will give me the ability to truely migrate the database to the new version with out losing data.

If you would like more information on how I did the oncreate part let me know..
-chrobi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic