I am working on session based App using kaltura resftful APis.
The design is such i have a view pager+tablayout in each page i have a fragment and all fragment is bound to single activity.
In splash i connect to Api and create a sesssion now i have multiple network calls (and all must be done in async task) .
Problem statement:
Let's say i have C1,C2,C3,C4,C5,C6 fragments and
every C has it's own set of data(Via n/w call,asynctask ) loading data blocks main thread and if user swipes to another page a new asynctask is executed while previous background thread is still loading which causes lags and ANR.
Suggestion:
What is best approach to manage each fragment's network call : should i create thread pooler for these async tasks around 8-10 and start thread pooler in splash.
I am very keen on activity's memory leak and want to achieve fast loading of viewpager(fragment's views) i read many SO questions and @commonsWare Blog and also
this discussion on thread pooler but want to know better approach/architecture of doing above stated question.