Best way to launch different tasks
<p>I am developing an application for blind people. I have to work all the time with the TextToSpeech module, GPS and Network connection.</p>

<p>I need to do a query like this: Consult the GPS, do a JSON call and calling the TextToSpeech(TTS) module.</p>

<p>I am wondering the best way to deal with the different tasks which communicate with the UI main thread. I have seen so far:
Handler objects and AsyncTask class.</p>

<p>I have to launch each task sequentially, so I want to call the TTS after retrieving data from the network. So I have used "mHandler.post(Runnable)" and inside that runnable calling another one and so on.</p>

<p>However I have seen that is recommendable the use of the AsynTask class. But in this case I think I have to implement a different class for every task, whereas I don't know if those tasks will execute sequentially. Something like:</p>

<pre><code>AsyntaskClass1 at1;
AsyntaskClass2 at2;
AsyntaskClass3 at3;

at1.execute();
at2.execute();
at3.execute();
</code></pre>

<p>Will that tasks execute in order? Cause the TTS module have to wait for the network task to finish...</p>

<p>Thanks for your help,</p>

<p>BR.David.</p>
