IntelliJ Java IDE
The moose likes Android and the fly likes push database to rooted device Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "push database to rooted device" Watch "push database to rooted device" New topic
Author

push database to rooted device

Uchiha Kanda
Greenhorn

Joined: Dec 05, 2011
Posts: 1
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

Joined: Dec 06, 2011
Posts: 7
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
 
 
subject: push database to rooted device
 
Threads others viewed
Records not getting updated when PreUpdate listener is used in Hibernate
Flush...
Inserting images in to the database
Is there any tool avaiable to monitor Sqlite database
developer file tools