it's not be better to take those couple of inet actions and involved them by start a separate Thread which will handle this part of data management ?
google everywhere put it's patterns which if u look closest they all are derived from simple classes... this API makes android like a spider web callback involving callback... Try to understand basics of java and it will not be difficult to write a piece of good code. Services/content resolvers/receivers/loaders are limited somehow... Threads are almost able to achieve anything what u wish to...
Most of you uses the code without thinking and not even try to understand how it work, and understanding what is the programming key. I try not to use code whose basics i dont know. And if i need to I studied it thoroughly. I used Java for black magic now I think it's DATA FLOW A-> B-> C etc .. good FLOW is essential.
EDIT:
yes i wrote the solution for youre problem
there is many ways to achive that what u want but it's not my response to writer code for you
you can use IntentService class it has a built-in queue --- just use separate startService() calls for each transfer.
you can use Thread - my prefered way
you can use Service
you can use AsyncTaskLoader
but don't use ASYNC TASK if u need fire more than TWO linked with each other at ONCE they all on MODERN PHONES RUNS as QUEUE on a single thread (ps. you can run them on EXECUOR as a workaround)
Since JAVA 1.5 tasks are separated from threads
- there was added
what do du mean by custom thread
THREAD (as we speak of it) is not a THREAD CLASS OBJECT but it is a TASK defined in run() method of THREAD CLASS so any CLASS DERIVED from THREAD STILL STARTS THREAD (aka TASK)
public synchronized void start() {
checkNotStarted();
hasBeenStarted = true;
/**
* look at this line i'ts rerouting run() code of youre thread class
* to native method from there thread is created in pure C code
*/
nativeCreate(this, stackSize, daemon);
}
like this for example in POSIX :
int pthread_create(pthread_t * thread, pthread_attr_t * attr, void *
(*start_routine)(void *), void * arg);
from this point we can talk about MULTITASKING when OS is performing multiple tasks over a certain period of time by executing them concurrently
since JAVA 1.5 ther is a Executor interface which provides a way of decoupling task submission from the mechanics of how each task will be run, including details of thread use, scheduling, etc. Executor is normally used instead of explicitly creating threads. You have many executors one of them is: ThreadPerTaskExecutor
class ThreadPerTaskExecutor implements Executor {
public void execute(Runnable r) {
new Thread(r).start();
}
}
This executor spawns a new thread for each task.
getting back to AsyncTask:
AsyncTaskM<P, P, R>.executeOnExecutor(Executor,P);
allow multiple tasks to run in parallel on a pool of threads managed by AsyncTask, however you can also use your own Executor for custombehavior.
and yes if You do not feel up to it and do not know enough beeter to someone else do it :)
I hope that this addition change your mind about your vote.