开发者

Asynchronous Sockets implementation on Android

开发者 https://www.devze.com 2023-01-16 18:52 出处:网络
In iPhone there is Cocoa Asynchronous socket library. Is there a similar library in Java for Android? Can it be done using Java Asynchr开发者_如何学Conous sockets(NIO library) or is there a way I can

In iPhone there is Cocoa Asynchronous socket library. Is there a similar library in Java for Android? Can it be done using Java Asynchr开发者_如何学Conous sockets(NIO library) or is there a way I can make use of NDK for Android and use native libraries for asynchronous sockets?


Not as far as I know, but it does have the sockets capabilities you would expect from a a modern *nix, so you should be able to emulate this using either java or native code.

Probably you would create a thread to handle the sockets asynchronously which you would communicate with using messages and handlers; alternatively you could do this by creating an android service, either within your activity's process or in a separate one.

0

精彩评论

暂无评论...
验证码 换一张
取 消