Hi all, I am starting to develop a new app and I am a bit confused
about the structure I need to give it.

I need to react to broadcast intents, so I placed a broadcast received
in the manifest.

Every single intent produces an action to be performed. Now the first
question: should I start a service (maybe with non_sticky option?) or
should I start a thread (or an async task) directly from the broadcast
receiver?

If I start a service, should I do all the stuff in its body, or should
it start a thread.
I should do the heavy job in a thread if there are time consuming
operations, but what if the gui of my application is just an activity
with the options and a button to start the service. What is the point
in keeping the main thread busy? Do I risk to be killed for not being
responsive?

I read here and there that I can update the gui from a background
thread. Can I do that even if it is started from a service?

The AsyncTask's onProgressUpdate is said to run in the application
main thread, but if the application is made of different activities,
who tells me which activity is the user looking at while the thread is
doing all its long work? The user could change activity in the
meanwhile and then the update would be unuseful..

I know it's (quite) a lot of questions, but I need to get some
clarifications before taking the wrong path.

Many (many) thanks in advance,

    Federico

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to