Possible Duplicate:
sqlite example program in android
I need to open a database where I know the path/name, I need to read a known value, and write a value. I don't want to write 100 line "helper classes," I simply want to use the classes/functions that already exist. Can anybody provide a a simple example for this? It really shouldn't be more than a few lines of code.
1: Open database:
maybe this? openDatabase(String path, SQLiteDatabase.CursorFactory factory, int flags)
2: Execute SQL to display value (in a Toast perhaps)
3: Close database
Once I understand this basic functionality I will then worry about helper classes etc. Thanks in advance.
EDIT:
Fascinating that every single answer so far links to articles that do EXACTLY what I asked not to do. I just want a simple 3 line example of how to directly open a database and read from it.
A very good SQLite tutorial.
Run through the notepad tutorial
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With