I am in process of developing an network based UI app for Android which would perform following kind of functionalities
Considering above situations, the app would probably have to spawn multiple thread's for multiple connections and managing them.So my query is
Is it good approach to develop the network module using Boost.Asio libraries ? Or it is okay to open upto 100 of socket threads for connectivity?
If Boost.Asio is used, then network module would be developed seperately using NDK, to access JNI would come into place, which in turn could lead to slow response?
Alternatively, can there be other better options? Looking forward for your inputs!
Many thanks in advance.
I suggest taking a look at New I/O, which is supported on Android. Using it you can handle multiple connections in a single thread, the API is similar in principle to Posix select()
call.
If you decide to go for your second option (networking code implemented in C/C++) I don't think you should be worried about JNI performance. Significant part of Android APIs is just a thin JNI wrapper on top of C/C++ anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With