How to run an infinite loop in Android without freezing the UI? -


i'm creating , android program needs to continuously keep sending data on bluetooth use this:

for(;;) { //send message } 

though works freezes ui , app how can implement same without freezing ui?

i sure app sending data monitor data.

put loop in asynctask, service separate thread or in thread beside activity. never heavy work, infinte loops, or blocking calls in main (ui) thread.


Comments

Popular posts from this blog

Glib GIOChannel -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -

python - Obscure curses error message when creating a sub window -