0

I have made a sample.sql database with "SQL Lite Manager".

How can I access this in an Android project?

2 Answers 2

1
  1. Put your prebuild database file in /assets directory in your apk,

  2. and on first use copy to "/data/data/<application_package>/databases/" directory.

Now use it with SQLite Database Helper class in your android application...

For more info look at this Article

Sign up to request clarification or add additional context in comments.

Comments

0

There are several steps to using an existing SQLite data base in an Android project. They are nicely described in this blog post by Juan-Manuel Fluxà.

Basically, you need to make sure that the data base contains certain tables and column names, then when your program first runs, copy the data base from your assets or resources folder to the standard db location for your app. The latter step is best done by writing a DataBaseHelper class the way that Fluxà describes.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.