I need to build a table with 1 column and many rows, I am getting data from a server, and then I want to populate this data into the table.
In iOS I can use UITableVIew. As I understand, I need to create gridLayout on builder and then I need to find it by id in the method onCreate. Then I need to pass this object to my Asyncr class, then I need to get data and build table in the method onpostexecute.
Which of the methods I need to use? I want to do simple table like this (but example on iOS) without headers with date
Also i need to do clickable row, if you click on row i need to send you on other activity
Any ideas ?
You can use custom ListView
In onPostExecute(Object obj) parse your data, and set the adapter.
Related
I need to get all values from JFX Table View. Tell me to way for that. it's very important to me. below has that table.
If you want to get all items in the TableView you can use the getItems method. Otherwise if you want only the selected data, you can use a SelectionModel to get the selected item.
I need to recreate this table in my app: https://imgur.com/a/1HtpFqO
The third field must be editable by the user, so I don't know if I should prefer ListView for this reason. What do you think?
Also, do you know if are there existing library to create this exactly design?
That depends whether your table holds data that will change or you will always have the same table with editable third field. If you have static data you don't really need to have a list.
If you have data that changes, RecyclerView is your go to option. Create it with different ViewHolder types, one type for non-editable fields and the other for editable field.
Also, there is no need to add 3rd party library just to achieve this simple table.
You can use Recyclerview with different views Like this and this
I'm a beginner android developer. I am creating an app but having trouble to get a rough outline for my next task which I am going to explain below. I am not asking for code. I just want to know the best way to do the below.
I have an Activity that displays a RecyclerView with a list of items like this:
My question is related to the 3 checkboxes.
How should I approach creating the layout in the pic? Do I have to include 3 checkboxes and 3 booleans in my main object class? The other items in the object class are saved in SQL database and the RecyclerView in the activity gets its data from there using a cursor. Can the value of the checkboxes be retrieved using the cursor?
Do I create a separate sparseBooleanArray for the checkboxes? Do I create a HashMap for them?
Should I store the value of the checkboxes (Checked/Not Checked) in SQL or SharedPreferences?
This is basically an opinion based question and hence I am throwing some suggestions on how you should implement it. If I have understood your problem correctly, you have provided a single list item in your RecyclerView and the items are being populated from a local sqlite database table.
Hence there are three checkboxes for each of the list item and yes, of course you need to save the states of the checkboxes in your sqlite table along with the information of the list item. I do not know about your current table structure. However, the pseudo implementation of your updated table structure may look something like the following.
item_id description checked_status
----------------------------------------
1 Some desc null (Not checked)
2 Some desc LOCK
3 Some desc DONE
4 Some desc NOTIFY_ME
Hence when you are clicking on your checkbox, you need to update the sqlite table accordingly with the newly updated data for that specific row and update the RecyclerView items accordingly.
I'm trying to decide on the best way to display a timetable to the user.
Ideally I wanted the data to be displayed in a table layout but I quickly realized that each table row required like 18 text views for the relevant data.
I've checked a calendar component, no use. A table layout does seem the best way to go but what's the best way to implement it so that it's easy to get data from my DB and read it into the table?
You can use GridView with its adapter:
https://developer.android.com/guide/topics/ui/layout/gridview.html
Could somebody give me a suggestion on how to simply and effectively make GUI representation of directories which are contained inside the database. Now, getting information using SQL queries is one thing. I can do that.
In fact using separate small examples I can put a file inside the database along with his information and I can get the file out of the database. The thing is I was just doing this without GUI, just to test does it work.
Now I need a GUI of this and I really don't know where to start. DO I use JTable, JList or something third? Also, I think I need an multidimensional array because I have, for example, id of a file, name_of_file and size.
So I need different types to put them in: int, String and int.
Also, I need to obviously hide the id of a file from the user yet keep it at the same time in order to be able to reference it.
How do I hide it in a GUI component?
So, let's say that I have a database table for files with these columns:
id, name, size, binary_of_file.
My real table has a bit more of columns like, id of a parent directory, id of a owner, etc. but for now this is not important.
So, I tell database to give me all info about the file (except it's binary because I just want to list the files):
...
ResultSet rs = statementObject.executeQuery("SELECT id, name, size FROM Files;");
while(rs.next()){
//Where do I store the values in? Which GUI component and how?
...
I guess I need an JPanel that will contain this component that will show my files from the database. What component? Please help!
It sounds like you want to use a JTable, it has a TableModel interface that you can implement to adapt to your resultset.
Also follow the link at the top of the docs. to Creating a Table Model.
Perhaps a combined JList/JTable component would fit this need.
That is a screen shot of the GUI of FileBro.
My idea is that the JTree on the left would represent the 'directories' and table (names) of the DB. The JTable on the right would contain the data of the selected table. Change the Locate Open Edit Print buttons for Create Update Delete and the panel below that to show details of records, and it would be the start of a DB CRUD component.