I have a listview in which a user adds his comments on a particular topic, these are then stored on server,
as multiple users may add comment i wish the listview to update periodically (say 10sec),
and add only the latest data and not the complete data as it will slow down the application.
How do i do this.?
Fix some Buffer Comments something like 50. If the number of comments is more than 50 then display the last 50 comments only. Implement pagination concept from the server. Keep some 'Load More' button or Auto Load functionality(just like in twitter or facebook) for viewing more rows in the List.
Related
I'm using firebase database to store data. I know how to use firebase database.
In my project I've an activity which displays a list of notices from faculties to students and by clicking on list item it will open another activity which is a chat room. In this activity student can ask question related to given notice.
Now, In first list activity I've also added on text view which displays the total number of chat messages for that particular Notice. It works well when i load data from database initially. But i want to change number of chat messages dynamically.
So, i need to listnen at chat_cnt node to update value of message_cnt text view
and problem is it is a big list so i can not use child_added for each and every notice item and if i use value_event listener than it will load all data unnecessarily at start.
The code is a little bit big so i cannot post it here. But I've described the problem.
Any answer would be appreciated, thanks. Sorry for my english :)
I have a nasty bug when using Tableviews on Appcelerator.
When I enter the app the user is promoted to enter a username and a password then i fetch data from a Server and display it in the Tableview.
There is a filter method to get specific items from the Server. They are send via a Json and i convert them to TableViewRows.
this works like a charm even multiple times. But when i click on a Row it opens a new View (where the user can interact with the data provided for this row)
The problem starts when I'm returning to that previous view where the TableView is.
It doesn't work anymore.
It does not matter how i populate the TableView data
TableView.data=someData doesn't work, TableView.setData(someData) doesn't work and setting a Timeout to set the Data also does not work.
After adding the Data by the described methods above, the Tableview does not Show the Data. But if i Debug it i can see that the new Rows are added to the Tableview but are not Displayed.
Any suggestions?
I am quite new to Android development. I managed to get data saved to SQLite database. Now, what I want is to view these data when I call viewData(). I have viewData() which shows data as a Toast as I made it as a sample. Now I need these data to show on a new activity but the number of data to show is depending on how many data is in the database at the moment, If user saved 10 items then I want all the 10 items to shown up. How can I do it?
What is the best way to show data from SQLite database on an activity. Since I don't know to use ListView, I used TableLayout on the other activity where user feed data.
I hope my question is clear.
Thanks in advance.
I have a scenario here.I am developing a housing app in which the Complex owners can post announcements and flat owners can see it.I am using webservice.The complex owner can add a new announcement(which I am saving in my server) and the flat owners can see those announcements(I am binding the announcements headers into a list view through json parsing and on-clicking a header a full message will be displayed).
Now the problem is in case of new announcements.I want to distinguish between the readed and unreaded messages(just like in our mail).So how can I determine which listview item is clicked or which item is not clicked??And also how can I give them different colors(i.e. to mark an item unreaded or not clicked ??)
Any help will be appreciated.
Save all announcements in a table locally in sqlite. Add a column to contain the read unread flag.
While populating the list read from the table and load considering the flag.
I'm programming an Android app that shows data from MySQL database via ListView with some sorting:
1) Items that are closer to android phone by GPS are shown firstly
If there are 2 or more items with equal distance, second sorting parameter applies - time.
2) Items that are closer in time are showm firstly.
Here is a scheme of the process that I guess to implement:
My idea is to get all needed rows into Array, then make some PHP manipulations with it and then pull sorted Array to the phone.
(as shown on the image above)
So please advice me what will be the proper way?
Maybe there is easier method for this functionality?
Or maybe I should do all the sortings exactly in the Android app when programming ListView, getting only standard "SELECT *" array from the database? Then, is there an opportunity to create a ListView with sorting based on calculated values?