hademylola
Lurker
Hello Team.,
Please i need someone to advise me on the best way to organise a chat concept.
I have a running instant chat application using Android studio. The concept i use for getting instant feeds/messages for the users is this.
1. upon launching the application, a function is called (getData()) which fetches all messages at the receiver side of my chatconversation table in database. and display accordingly on LISTVIEW
2. i have a variable called countmessage, this variable stores the totalnumber of messages fetched and a timer () updatefetch is trigger to constantly check the database for all messages at the background but will not have to refresh my listview not until the timer fetch total number of messages greater than the countmessage.
If this happens, the countmessage variable will be updated with this count and listview adapter is refreshed to display the new messages after which timer continues its fetch all over again searching for new messages.
This methods works really fine, but crashes my application after some minutes, with OutMemoryError on my log.
Please i need help at this junction.
regards
Please i need someone to advise me on the best way to organise a chat concept.
I have a running instant chat application using Android studio. The concept i use for getting instant feeds/messages for the users is this.
1. upon launching the application, a function is called (getData()) which fetches all messages at the receiver side of my chatconversation table in database. and display accordingly on LISTVIEW
2. i have a variable called countmessage, this variable stores the totalnumber of messages fetched and a timer () updatefetch is trigger to constantly check the database for all messages at the background but will not have to refresh my listview not until the timer fetch total number of messages greater than the countmessage.
If this happens, the countmessage variable will be updated with this count and listview adapter is refreshed to display the new messages after which timer continues its fetch all over again searching for new messages.
This methods works really fine, but crashes my application after some minutes, with OutMemoryError on my log.
Please i need help at this junction.
regards