My app makes use of threads and uses handlers to send messages to the gui.
The thread maintain a connection to a server and receive messages from it.

The problem I'm having is that sometimes messages arrive really fast, and
although the app doesn't anr, the UI freezes as it tries to cope with the
fast influx of messages in the queue.

The rate at which messages arrive from the server is beyond my control, but
I need to find a way to throttle to make sure the UI stays responsive. I've
read about people having issues in games where touch events have a negative
effect on fps and they've used thread.sleep to throttle. Although similar to
my issue, I don't think it would work for me because both the UI and
background threads as just as important here.

Does anyone have any other ideas for solving this? Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to