How to create table with runtime data addition - Android - android

I want to create a table in my android application, in which the data will be added on the run time i.e. no. of columns and rows would be decided on the base of user input and user can later add more columns or rows in the Table.
So, using Table Layout of Android is not solving my purpose so far. And I created the table using Linear Layouts under other linear layout, but as I add any row or column I have to create the whole view again which is making the application very slow. So, what can be other approaches or how can I improve the functionality of my application.
Thanks in Adavance.

Related

Creating a Dynamic Table?

I am learning android development ,I want to create dynamic table rows .I don't know how to create .I want to create two table .One should static and Another should be dynamic .
I referred in internet and i saw table layout , recycler view and I don't know which is best way to do it.Please someone guid me.
I want to create a tables like this
I have tried like this only
You cannot simply create table and rows as simple as in webpages. you have to use TableLayout,TableRow and textview(for rendering text inside of it).
create no of textviews as cell and add it to TableRow(android layout) then add the tablerow and add it to TableLayout and then add tablelayout to root layout. On dynamic insertation invalidate the view to see changes

How generate layout dynamically from mysql?

Is it possible to create a layout for an application on android from fields in a database?
I have a table in the database that contains questions and I want to generate a "form" or "layout" depending on the data that is in that table.
For example, I have question one:
as we see in the table I have the column "tipo_pregunta" which is what it will say if it is an input, checkbox, textarea, etc.
I wanted to know if it is possible or if you know some guide from which I can learn.
Yes. Of course, you can generate layout dynamically.
Create layout(LinearLayout, RelativeLayout etc) object.
Iterate database result
Create a view on checking your "tipo_pregunta" value. like(TextView, Checkbox, RadioButton etc)
Add this created view in your layout object - layoutObj.add(viewObj);
Repeat steps 3 & 4 till your database result count.

Which is the best layout for the table and row views, I can edit, delete, and updated data in each table based on row like in Android

I am new in android application I want to create a table which will populate data from SQlite and show in a table with rows, columns, and then I want to edit, modify data in each column based on rows. I also want to disappear row after finishing modifications with click on a button. My question is, which layout should I use, Table layout or Grid view/layout????
I would suggest using a Table Layout. Although it uses table row as its child, you can actually use any View subclass as the child. Also, for your purposes, there is a lot of examples online for using a TableLayout and populating it with data from SQLite. A nice thing about the tableLayout is that it manages each row nicely in terms of sizing.

Create a table in android to display data

This should ideally be an easy task but I am unable to figure out how to display data in a table with borders in android.
I have looked at this How can I create a table with borders in Android? and it kind of seems to be what I am looking for , but the number of rows and columns are not known before hand to be. I would have to create them on the fly. Does anyone know how to create a table in xml and then insert a row or column later?

Table data showing

I am building one app which is a copy of a website.
In that website they showed some bulk of data in a table view (with multiple rows and columns)
I want to show the same bulk of data in android mobile.
But the problem is which widget will be reliable to show large amount of data (like table). And which widget will give efficient and professional look.
Please suggest some widget or views
For a static (predefined/known)
content you can use TableLayout,
as in this example,
For dynamically populate the table
you should use a GridView
(considering as an option the
ListView as well: if you don't
have many columns, an proper item
renderer would be more efficient).

Categories

Resources