Answer the question
In order to leave comments, you need to log in
SQLite for android?
For five days now I can’t figure out how to use the database for android applications. I re-read a cloud of material, coded even more, but the understanding did not come.
What you need:
1) Create a database with two columns
2) Add an element to the database
3) Read the database through the list view
Answer the question
In order to leave comments, you need to log in
The fact is that this method involves creating extra objects, such as List, then passing over the cursor and writing new elements to the list, and then loading all this into the list.
The first step for you would be to get familiar with the CursorAdapter. It allows you to populate a ListView with a cursor. Here is a good tutorial on how to use it.
And then it would be extremely good for you to master a bunch of Content Provider'a and CursorLoadera. It will allow you to fill the table asynchronously and track changes in it in a convenient way. This method is best described in this book . I read many lessons and articles on this topic, but I managed to fully understand and implement it only after reading several chapters of this book and this oneArticles by Lars Vogell. After spending a few days and a little nerve on this, you will fully experience the increase in your skills.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question