Found more than 10 tutorials to “cursors” but I can’t understand that.
My question is: How can I read data from a database?
For example:
Database name: Test_Database
Table name: tbl_users
In it are two columns: id, user_name
Now I like to read the user_name with id 3
==> SELECT user_name FROM tbl_useres WHERE id = 3
How can I give that out to a TextView, Toast or Alert?
The best way to achieve this (at least my opinion ) is to create your custom
SqliteDatabaseHelperand you can create a function like this :which returns
Cursorand after that you can use this cursor like :This is at least how I’m using
Cursorto get data from Database.Hope it helps.