11

Is there a decent mechanism for doing asynchronous I/O using sockets on Android?

I'm aware of the existence of nio channels, but they don't work for me because I need to be able to use MulticastSockets and BluetoothSockets, neither of which support channels.

I'm aware the answer is probably that there isn't one, but as this is a fairly big piece of work I thought I'd ask first to be sure. And if anyone knows of a decent third-party library I might be able to use...

David Given
  • 13,277
  • 9
  • 76
  • 123

2 Answers2

3

Other than nio I don't know any built-in option for this problem however there is an interesting answered question on this already on SO.

Take a look at it maybe the third party libraries will help you. Asynchronous IO in Java?

I can't tell how well those libraries work on Android you might also have to get them Android-ready in order to work correctly.

Community
  • 1
  • 1
Octavian Helm
  • 39,405
  • 19
  • 98
  • 102
  • 8
    Thanks --- unfortunately none of those really did what I wanted so I'm rolling my own. What use is a wheel if you can't reinvent it? Sigh. I'll see if I can persuade my boss to let me release the library as open source once I'm done. – David Given Oct 25 '10 at 11:33
  • You'd probably better take those away; it looks like it's not going to be open sourced. Sorry... – David Given Oct 06 '11 at 21:21
0

I'm using this: https://stackoverflow.com/a/9832633/516188

but keep in mind my comment to that solution, under the solution itself.

Community
  • 1
  • 1
Emmanuel Touzery
  • 9,008
  • 3
  • 65
  • 81