-1

i have just started making android app but i don't know how to use a already made database on SQLiteDatabase to display its content in my android app.
I have made data base helper class.

I want to acess the database information to b displayed in my app like name city etc.

So i want to know how i should write query so that i can access the data and display it in my app.

I am not asking how to make data base helper clas i m asking how to write query in my main.java so that database is displayed in my app

  • 2
    Please be much more specific about what problems you are having. – CommonsWare May 11 '14 at 15:59
  • You have to get it from the asset folder, where you previously stored it. Then copy it to the proper folder, `/data/data/your.app.name/databases/your.db` – Phantômaxx May 11 '14 at 16:01
  • You don't even need 3rd party libraries for doing that: http://stackoverflow.com/a/18806587/2649012 – Phantômaxx May 11 '14 at 16:12
  • possible duplicate of [How to use an existing database with an Android application](http://stackoverflow.com/questions/9109438/how-to-use-an-existing-database-with-an-android-application) – Phantômaxx May 11 '14 at 16:12
  • Be more specific, problem connecting to database? getting/storing data? any other? – Rakib May 11 '14 at 16:15
  • Every one is telling me that it is a duplicate to how to use existing android app. but i have already mentioned that i have made database helper class. Then why you all are refering me to those links. I want to know that how i can write query to display the database in my app – user3625750 May 11 '14 at 16:34

1 Answers1

1

I have used this Library to load an existing .db sqlite-file into my Android-App Database from the assets folder. It worked very well and I recommand you to read the how--to on the main page of the project.

Simulant
  • 19,190
  • 8
  • 63
  • 98