Two Laptop Bag*
The moose likes Android and the fly likes How to access and open an existing SQLite database (in Eclipse/Emulator) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "How to access and open an existing SQLite database (in Eclipse/Emulator)" Watch "How to access and open an existing SQLite database (in Eclipse/Emulator)" New topic
Author

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

Chris Trout
Greenhorn

Joined: May 05, 2010
Posts: 16
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

Joined: May 05, 2010
Posts: 16
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to access and open an existing SQLite database (in Eclipse/Emulator)
 
Similar Threads
Library List(s) in Websphere...
I'm desperated about RateControl
Byte[] to image
What Hardware For Android
how install in Eclipse(Java/Android) emulator for Tablet PC Android