hhmm ok...
So I guess it should be possible for example to make my own class
extending AsyncTask and implementing callaback interfaces to it from
the aforementioned modules, does that sound feasable/logical at all ?
I was wondering though, because its somewhat asynchronous operations
how should that be implemented ?
Specifically, I know that the method doInBackground will actually do
the work, but in my case the work is asynchronous itself... The
conneciton module has to be started, then the AsynTask will have to
wait for a response from that module telling it it's done downloading,
then the AsyncTask should start the parsing, wait till that's done and
then finally it can write to the DB...
These status callbacks can be implemented through my own interfaces,
but other methods would be called and not for example the
doInBackground...
Am I making my problem any clearer now ? :D

On 27 apr, 18:00, Mark Murphy <mmur...@commonsware.com> wrote:
> MobDev wrote:
> > Hi,
> > I am using an AsyncTask to start out a sequence of events to retrieve
> > data from the net, parse this data and then write it to the
> > Database...
> > I have divided my code into several modules, one for networking
> > operations (which is used for retrieving the data), one for xml-
> > parsing, and one for DB funtionality... The first one calls the second
> > one when it's done and so on...
> > So now I was wondering if there is some correct way to make an
> > AsyncTask "public" so that everyone of those modules is able to call
> > the progressUpdate() method to show the user what the general progress
> > is (like placing a horizontal progress bar on 1/3 when the data has
> > beendonwloaded, on 2/3 when the parsing is done and 3/3 when it's done
> > writing to the DB)...
>
> IMHO, the AsyncTask should be the driver, not be driven, so you would
> not need the AsyncTask to be public. The AsyncTask should know when you
> are 1/3 complete, 2/3 complete, etc. because it is one calling your
> other modules to have work be completed.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android 2.x Programming Books:http://commonsware.com/books
>
> --
> 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 
> athttp://groups.google.com/group/android-developers?hl=en

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