android - Having Listeners in Service or IntentService? -
i designing chat application xmpp, in order replace asynctask
improve solution (which doesnt memory leak, configuration changes have no effect, manages job queue's, running more 1 asynctask
@ moment, etc).
there came solution: intentservice
. @ first every thing makes uncertainty being, @ moment, asynctask
s live in service run days,and job network sending & receiving.
so in service have listeners, hear packets, i'm wondering intentservice
thought using listener service (since have seen intentservice
works intent
s, wondered may jobs upon requests), or should maintain basic service?
also i'm wondering: why utilize asynctask
when there intentservice
?
there came solution : intentservice
an intentservice
not designed scenario. designed bit of work on background thread, go away.
i should maintain basic service?
yes, though asynctask
not needed in service, not want doing on main application thread in service. utilize thread
or threadpoolexecutor
in service.
also im wondering why utilize asynctask when there intentservice?
among other reasons, asynctask
can utilize thread pool; intentservice
has 1 background thread.
android
No comments:
Post a Comment