I would like to ask for a basic scheme that I need to implement for threading in my android application. At this time I have scheme which looks like this :
MyActivity:
public void onCreate(){
//check some conditions and depending on that starts different methods
}
public void method1(){
// still checking some shits
}
public byte[] sync(byte[] buffer){
//there is actually thread which synchronize with web server. this method only gets the server responce.
}
public byte[] sendRequest(){
// this method send the params to the server which needed for operations.
}
So basically I want to run everything on a threads, sending the params and receiving the server response. I need this because sometimes when my response is too big I get an OutOfMemoryException (or at least I thinkg that can fix the problem).
So any ideas what kind of structure I have to use about my app?
P.S. My OutOfMemory question (where you can see more about my problem): Android HttpEntityUtils OutOfMemoryException