• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

How to access and open an existing SQLite database (in Eclipse/Emulator)

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have created and loaded a small database via the SQLite3 command line tool.
I am developing in Eclipse and using the emulator to test with.
I would like to know what the accepted practice is for where to put the database in my Eclipse Android project folder structure, and how to access it in my java code.
It would also be good to know how to test for the existence of the database file before trying to open it as I think the method will create it if it doesn't exist and I don't want that.

Thank You in advance to those wishing to reply.

-Chris
 
Chris Trout
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been doing some research on this question and I'm wondering if any SQLite database used in an Android application needs to be created via the application code.
For example, if I create the database and load it ahead of time (which is typically what is done with a db used exclusively for look-up tasks) and place it in the "assets" folder of my Eclipse/Android project structure, do I need to open that file and read it byte-by-byte into a new (db) file I create.
From there I'm thinking I would use existing SQLite methods to open and access the db.

Any assistance on how to do this would be greatly appreciated.

Thanks
-Chris
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic