I'm developing an Android card game app and using smartfox client API in my project. When a user is playing game, smartfox server push responses to the client by invoking callbacks from back end and we need to manipulate app UI within these callbacks.
Now we need to manage threading in these callbacks so that it does not block UI thread as well as all UI updates happens only in UI thread.
We implemented Activity.runOnUiThread(Runnable) where ever we need to update UI. However this solutions doesn't seems to be much efficient. Sometime it works sometime not.
Please share if you do have a better mechanism to handle this kind of situation.