Just discovered that the http library causes a problem on higher SDK's/API's. Code that worked for last 6 months on older devices causes a problem in for example ICS. See here for more documentation: NetworkOnMainThreadException | Android Developers
Higher SDK's shouldn't do networking anymore on the main thread. How can we solve this issue?
The response can be retrieved either synchronously or asynchronously. Unlike the request it does make sense in some cases, when the content is very short, to retrieve the response synchronously as you already have a valid connection.
You can also keep the target version to be lower than 11.
Well, it suddenly becomes much more complicated then. Basically I have 3-4 API's that return data and some fast after each other (validation and data). I recognize these using the TaskID (every API has a task ID). That would mean data cannot be stored in the same buffer (otherwise I don't know what is what) and mostly I don't know how big the returned data is. I use this for example for Twitter, Foursquare etc.
Not sure how keeping it on v11 will work with Ice Cream Sandwich? Top priority is the speed of the response showing.
Overall it use around 15 different API calls per application, I will test what is the best approach and gives me the best performance and what is the best scenario.
Async calls are not always returning in the sequence called, so it could give me strange results.
I know but what if I want to use newer API stuff? So I guess I need to do my test cycle again with Async. Will take a while because of multiple API's and some called right after each other.
Anyway, will solve it hopefully. Its not getting easier