java - How many Handlers I need when multithreading -


i have tried googling while couldn't found clear answer. have android software should listen multiple udp ports. if i'm not mistaken, have create own thread each port. after port receives data, should passed ui-thread.

after research concluded should use handlers provide data ui-thread. however, i'm bit confused how many handlers i'd need. each thread require own handler or single shared 1 enough?

for background info, i'm trying create timed threads check received udp-packets every 100ms , update contents ui-thread's views.

i create handler on ui thread , pass handler reference each thread (so need 1 handler object). in way since handler created on ui thread, handlemessage executed on ui thread - careful each message processed through handlemessage executed fast.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -