简体   繁体   中英

How to use my own sqlite database and search through it in android?

I'm a beginner in Android development. I'm trying to make an app where you search for name and show the matching results (from a database) in a listview. Since there's a lot of data, I thought it would be best to write a database without using the SQLiteOpenHandler. So now that I have my .db file, I need a way to be able to use it in my app from the assets folder and also to be able to search through it.

I found to links which I thought could be useful.

http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/

This shows how to use an existing database.

http://developer.android.com/training/search/search.html

And this is Google's information on storing and searching data. I need to know is it possible to somehow combine these two methods together to achieve what I'm looking for?

You can use this extended SQLiteOpenHelper . It helps to copy the db file from assets folder in your application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM