I'm making a game for both iOS and Android using Cocos2d-x. The game has some downloadable content. The content isn't too large. Probably 50 Kb at the most. How can I download this data asynchronously in a Cocos2d-x app for iOS and Android?
If the project was iOS only I would just use an Objective-c async url request. If the project was Android only I'd use the Java equivalent. Since the majority of my project's code is C++ I'm not sure how to proceed.
There are CCHttpRequest in /extensions. See it's usage in TestCpp example (and note that CCHttpRequest object cannot be autoreleased and shouldn't be released manually after request finished).
This extenshion always executed in separate thread and always executes callback in main thread, passing response data to it.