Questions tagged [androidasync-koush]

Asynchronous socket, http (client+server), websocket, and socket.io library for android by Koushik Dutta. Based on nio, not threads.

AndroidAsync

AndroidAsync is a low-level network protocol library. If you are looking for an easy-to-use, higher level, Android-aware http request library, check out Ion (it is built on top of AndroidAsync). The typical Android app developer would probably be more interested in Ion.

But if you're looking for a raw Socket, HTTP client/server, WebSocket, and Socket.IO library for Android, AndroidAsync is it.

Features

  • Based on NIO. One thread, driven by callbacks. Highly efficient.
  • All operations return a Future that can be cancelled
  • Socket client + socket server
  • HTTP client + server
  • WebSocket client + server
  • Socket.IO client

Usage

Usage and more info at the official repository: https://github.com/koush/AndroidAsync

41 questions
7
votes
1 answer

How to close/retry/manage a WebSocket using Koush AndroidAsync?

I'm using Koush's AndroidAsync for a WebSocket client. My code follows the example at https://github.com/koush/AndroidAsync and works. (Example copied below.) I need my app to open a websocket when it starts, however, I need to handle a few…
proximous
  • 617
  • 1
  • 10
  • 28
7
votes
2 answers

AndroidAsync websockets not working

I am using this AndroidSync library by koush to to create websocket (server/client) and transfer data between two android devices. The two devices are connected via wifi(one is Wifi AP and other is connected to it ). I get TimeoutException in client…
suheb
  • 1,509
  • 2
  • 13
  • 19
5
votes
0 answers

koush Websocket handshake failing

I am trying out the library by koush https://github.com/koush/AndroidAsync. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AsyncHttpClient.getDefaultInstance().websocket(uri, null, new…
user3133966
  • 193
  • 1
  • 12
4
votes
2 answers

How to check if WebSocket is connected

I created a Websocket service class using KOUSH library https://github.com/koush/AndroidAsync#can-also-create-web-sockets Now I want to check if the Websocket is connected to my server from my mainActivity. Do you know how I can check this? thanks…
Thiago
  • 12,778
  • 14
  • 93
  • 110
4
votes
0 answers

AndroidAsync Socket.io ArrayIndexOutOfBoundsException

I am using socket.io 0.9.14 on the server and the 1.2.5 AndroidAsync library from koush. I get java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 exception when I use the SocketIOClient.connect method. Here is the attached stacktrace.
VBK
  • 1,435
  • 1
  • 15
  • 34
4
votes
1 answer

AndroidAsync socket.io connection with querystring parameters

I've been working with using socket.io with Android for a few days now. As of now, I am using AndroidAsync by Koush. When I try to connect to my local socket.io server (http://192.168.2.1:3000) everything is okay, I can emit commands and receive…
SleepNot
  • 2,982
  • 10
  • 43
  • 72
3
votes
1 answer

Socket always time out with Android Libraries

Socket in Android won't connect even when on server (Java Server) with ServerSocket.Accpet() called before, the connection from client (Android Device) is Received and accepted but the client will never know and keeps timing out . Here's the…
Mahan
  • 77
  • 2
  • 9
3
votes
1 answer

Why is AndroidAsync disconnect time so long?

I'm using the AndroidAsync koush low level network protocol library. I am connecting to a server with WebSocket. I am able to connect, send/receive messages, and disconnect. My disconnect time is very long. Server does not detect the disconnect…
Lou Morda
  • 5,078
  • 2
  • 44
  • 49
3
votes
2 answers

koush AndroidAsync webSocket nullpointerexception

I try to use AndroidAsync library. Here is a code sample: AsyncHttpClient.getDefaultInstance() .websocket(url, null, new AsyncHttpClient.WebSocketConnectCallback() { @Override public void…
Sergey Novikov
  • 381
  • 3
  • 4
2
votes
1 answer

Slack Real-Time-Messaging websocket

Trying to implement this in application. Slack RTM After call to rtm.start I get JSON-response and extract wss url. After it, following documentation I need to open websocket. Tried two libraries compile…
Yaroslav
  • 4,750
  • 3
  • 22
  • 33
2
votes
1 answer

Socket.io client for Android

Koush is pulling support for socket.io in AnroidAsync [https://github.com/koush/AndroidAsync ], as the socket.io specs have changed. I've had little luck finding a replacement. Is there a similar library that supports socket.io client for Android?
crusader92
  • 50
  • 1
  • 8
2
votes
1 answer

TCP & UDP sockets using the AndroidAsync library

I'm looking for an example of how to use the AndroidAsync library to create a simple Socket or DatagramSocket. The sample in the git repo, the tests, and the examples on the homepage don't seem to cover this use case. I see the…
skunkwerk
  • 2,920
  • 2
  • 37
  • 55
2
votes
1 answer

Overriding HostnameVerifier with Ion

I am using Koushik Dutta's Ion networking library for Android. I need to override SSL checks for debugging purposes. I've found out how to set my own SSL context and TrustManager…
Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84
1
vote
1 answer

Error "No interface method setCallback" when calling ion client from an coroutine

According to Kotlin Extensions - async/await test, to use async web request i should encapsulate the call inside a coroutine, like the example below, taken from the test: private fun myGetAsync(url: String) = GlobalScope.async { try { …
MiguelSlv
  • 14,067
  • 15
  • 102
  • 169
1
vote
0 answers

AndroidAsync Multipart POST request body doesn't contain submitted file

I have a simple server in android that I'm trying to access from my PC. I can't handle POST requests with multipart data. The form data in the request body is always null server.get("/status", new HttpServerRequestCallback() { @Override …
Stylishcoder
  • 1,142
  • 1
  • 11
  • 21
1
2 3