• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

push database to rooted device

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I am a man of mystery. Mostly because of this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic