• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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
 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic