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
1
vote
0 answers

AsyncHttpClient koushikdutta "Cannot Resolve method GetString"

Currently implementing some example code based on the https://github.com/koush/AndroidAsync lib, getting unresolved method for ".getString" ".getJSONObject" and ".getJSONArray" Gradle is in sync and i have ran "invalidate cache and restart" Dep…
1
vote
0 answers

Unable to get disconnect callback event in Koush AndroidAsync?

I have implemented websocket client in my android application by using koushikdutta library. I want to get auto reconnect feature in my implementation but somehow when i turn off a mobile wifi and turn on back i unable to reconnect because of…
user565
  • 871
  • 1
  • 22
  • 47
1
vote
0 answers

Using AndroidAsync in my project

I'm following a tutorial where they want me to use android websockets library, unfortunately this library is deprecated and I should now use AndroidAsync. This should be an easy task for the common Android Developer, but I'm kinda new to Android…
Chris
  • 1,574
  • 4
  • 16
  • 49
1
vote
0 answers

Setting idle timeout for websocket connections using androidasync

Can I set an idle timeout for an inactive websocket connection using the available APIs of AndroidAsync or should I code my own timer? I need to cleanly kill the websocket connection if it's idle for 3 minutes.
1
vote
0 answers

AndroidAsync how to create SSL Client in websocket connection?

I have a problem. How to create SSL websocket client with self signed. mServer = new AsyncHttpServer(); mServer.websocket("/get", new AsyncHttpServer.WebSocketRequestCallback() { @Override public void onConnected(final WebSocket…
Myo Min Han
  • 1,633
  • 2
  • 12
  • 12
1
vote
0 answers

koush AndroidAsync Library Content-Type can't change

I want to make post http request using AndroidAsync library but i can't change the content-type to 'application/x-www-form-urlencoded' for request AsyncHttpPost post = new AsyncHttpPost(LOGIN_URL); MultipartFormDataBody body = new…
Ali Omari
  • 371
  • 3
  • 11
1
vote
1 answer

AndroidAsync: Failed to set websocket connection

I am working on a product where we have set of back-end servers where we established web-socket connection to transfer the data and for that i use AndroidAsync(V2.1.6) client library for that. Those servers are running on tomcat with different…
KunalK
  • 1,904
  • 4
  • 22
  • 40
1
vote
2 answers

How are timeouts set for AndroidAsync websockets?

I am trying to change the default AndroidAsync websocket initial connection timeout of 30 seconds. This is the working version with the default timeout: AsyncHttpClient.getDefaultInstance().websocket(connectionURI.toString(), null, this); I would…
mattm
  • 5,851
  • 11
  • 47
  • 77
1
vote
2 answers

onPongReceived is never called

My team is building an Android application that will use websockets to communicate with an existing backend. We chose to use the AndroidAsync by Koushik Dutta to handle this communication. I would like to register a ping to be sent periodically, to…
jmm
  • 1,044
  • 2
  • 12
  • 38
1
vote
1 answer

Socket.io client on Google Glass

Im trying to let my Google Glass and my android phone connect to a NodeJs server that Im running on my computer, so that I can send messages from my android phone to my Google Glass. For this Im using koush's AndroidAsync library, which works great…
1
vote
0 answers

Android: Able to send/receive files through Socket.IO (AndroidAsync)?

Is it possible to send/receive files through a Socket.IO connection using koush's AndroidAsync client? If there isn't a direct way, any workarounds? Thanks in advance!
The Nomad
  • 7,155
  • 14
  • 65
  • 100
1
vote
2 answers

Socket event for specified Android client

I'm writing a an Android app that connect to a socket implement by Node.JS + socket.io. I'm using AndroidAsync (https://github.com/koush/AndroidAsync) for Android Client. I want to emit some events that only specified client can listen. But I can't…
0
votes
1 answer

Imitate 'gzip' content encoding on byte array

I'm developing an application that uses .pbf files that are sent from the server to Mapbox GL JS using the header 'Content-Encoding: gzip' from PHP and am now trying to emulate the same behaviour for tiles from the storage. Now I can't do this in a…
0
votes
3 answers

Android Studio Gradle Error:Execution failed for task ':app:dexDebug' using Ion koush lib

I want to use the Ion Lib from koush in Android Studio. But after I synchronize the libraries in my gradle file and try to run the application a strange error occurs. My thought is that the Ion Lib does not accept the other libraries in my gradle…
0
votes
3 answers

AndroidAsync TCP -- proper way to detect socket is no longer available using write?

I am wondering what is the proper way to check on the client side that a TCP socket opened using the AndroidAsync library is no longer available? This is in the case the (plain TCP, non-AndroidAsync) server did not initiate explicitly closing the…
Objectist
  • 51
  • 6