What is the best way to create a data table in android?

I would like to create a table that is populated with data from DB . I know that you can create a dynamic table using TableLayout , but I'm not sure if this is the best solution in my case.
Here is an example of what I want to create (the first table on the page).

+4
source share
1 answer

I will tell you about it.

If your data is limited, and you will certainly display all of them on one screen presentably, then yes, TableLayout will be enough.

However, in the real world, flexibility is calculated, so you should always consider the possibility that your data may expand in the future. With this in mind, you should use ListView or RecyclerView in this case. Define a basic layout for each line of your list or list of recyclers, and then combine the data from your database with this view using a suitable adapter.

To get started: https://developer.android.com/training/material/lists-cards.html

+7
source

All Articles