I'm working on an application that needs to send coordinates to a server (using HTTP POST) when the distance to previous point is higher than a threshold value. Also, in the meantime, it needs to load a map from a server (HTTP GET) and possibly send some data to the server (text files, using HTTP POST). The application is multiview (one view+container for map, one view+container for the text file and one settings view+list). I need the coordinates to be send whatever the active view is, so I implemented the MPositionObserver and an instance of CClientEngine (from the example on this site) into the AppUI class. Which would be the best practice to handle all the HTTP POSTs and GETs? The main problem I see is that I wouldn't be able to determine from which type of request would be the server response. Is it better to have a ClientEngine for each view, or just one in the AppUI? Do I need to further abstract the HTTP layer and write some kind of connection manager class?
I did the same thing in Java ME and there I wrote a class which implemented a queue of HTTP threads and I could attach further information to that thread.