Hello,

I have an app in which there are several requests to a server in internet
(http), for example to retrieve images in threads outside the main UI
process.

The thing is that I have a Thread that manage the request with a while(!end)
loop and in the end a Thread.sleep(500) that checks if there are new
unhandled requests. As I read here [1] I know that this is not a good
practice. And users have complain about ANR (app not responding) in several
cases.

Knowing that obviously I want to refactor all the way my app manage the
requests and I want to do that the best way.

So, the question is; what is the best approach for doing this? A service? a
broadcast receiver and send intents when I need a request to be handled?

Thanks in advance and sorry for my english...

Jose Luis.


[1] http://developer.android.com/guide/practices/design/responsiveness.html

-- 
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