In one of my Parse.com classes/tables I'd like to have a column where another class/table can be stored for each row. As an example:
An User table with a Clothes row, in which a table with the name and color of each of the user's items can be stored.
I've done this using relations but was wondering if there's a way to do it without having to create another table and making a relation to it, since that creates two tables (the table itself and the relation). I'm just trying to make it so Parse.com has the least stress so querys or any method can be done in the least time.
Thanks, if I didn't make myself clear please ask.
Related
I am currently making a custom data table using advanced datatable package. Now managed to make it looked good, following the design I was given except one, how to make the last row different than the rest, fixed one where even if the user navigate to next page of table, the last row will still be there. Pretty much like this.
(sorry for the squared censors...)
I am trying to make the last row look like the "Total" row, so to make something like this in advanced data table? Or any other suggestion for a better paginated data table package?
This question already has answers here:
Android - Getting database ID from ListView selection
(2 answers)
Closed 6 years ago.
i got a problem with SQLite tables and a listview. I have implemented a db including tables and data and can display them in a listview. I want to edit the entries which is working well too. Only the ordering isn't as good as i want it.
When i want to show my entries ordered by column 1 or column 2 and edit the entry after that, i have the problem, that i used the position in the list for the position in the table (with cursor.moveToNext() for x times).
Now i solved it with reading out the whole table with
SELECT * FROM table ORDER BY column
Deleting and refilling the table with the ordered data. Then read out again and display it.
But this isn't a good neither a secure way to do it. If the app crashes while it's doing some work i could lose data. Is there a good way to get a reference where i have to edit in the listview without displaying it? Or should i work with custom ListView-layouts and an extra data class for the listview so i don't have to edit the whole db, just edit the data and after editing i rewrite it to the point in the database?
I didn't find a function for something like that in the SQLite doc. But maybe i didn't looked deep enough.
Thanks!
You shouldn't delete the whole database just to fill it again. This seems like an awful waste of time reading and deleting, over and over.
You should keep track of the id, belonging to the item you wish to edit. Once you are done editing update the specific item in the database, by referencing it with the id.
Im not sure, what it is that stands in the "column" column. But if you wish to sort the table in 2 ways, you could either provide another column with the attribute to sort them by, or change the order by using ascending/descending when ordering.
Let me start by giving a context.
I have 2 tables joined together by a many to many relationship as shown below.
In my Android application I have a need to show a list of the contents in the "JoinTable" (The join table will be filtered depending on the Table1 ID, this is the content that will be displayed to the user.)
Problem: I want the user to be able to group certain rows of the JoinTable together. I need to model this grouping system in the database so it can be queried later and the groups reappear. What is the best way to design the database with this capability?
Some more detail from a user perspective:
When a user selects an item from table one, that ID is sent to the next activity. The next activity queries the join table for the appropriate content. The way it's working now, it just shows one item per row from the JoinTable. The user should be able to for example, drag an item onto another item to group them together.
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?
I have 2 columns of data in my database in Android application. I want to display this data via a table format in my application. Please help me.
For example, I have employeename and department coulmns in the database. I want to retrieve this data and show it in a table format like a table with 2 columns. One side employeename and next column their respective department in my Android application.
Unless you want user interact with the table, you can use webview and make it load table html. Advantage of this method is that you can make it as fancy as you want.
If you want interaction with the table, you'd better use listview with customized row layout, or even gridview would work too.