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
0
votes
1 answer

POST with contentType application/json to Android AsyncHttpServer sets request body to null

I have AsyncHttpServer working on my Android device. I have reqquest callback method for POST set like this: server.post(pattern, new HttpServerRequestCallback() { @Override public void onRequest(AsyncHttpServerRequest request, …
Miljac
  • 2,045
  • 4
  • 19
  • 28
0
votes
0 answers

Android koush/ion post request being blocked by firewall

I'm using koush/ion library to send post request to my server. It works using my home wifi, my friend's wifi, mobile data, and other's mobile data except for the office wifi. It returns null and I've been wondering why. I somehow manage to print the…
0
votes
1 answer

Setting heartbeat interval in Android Async library by Koushik Dutta

I am using com.koushikdutta.async:androidasync:2.1.3 as Android SocketIO client library. Is there a way to change the default heartbeat interval in the library?
windchime
  • 1,253
  • 16
  • 37
0
votes
0 answers

Android FATAL EXCEPTION using AsyncServer from koushikdutta

Hello I am using AndroidAsync . if I try to send a message to the WebSocket and the connection drops, I get a FATAL EXCEPTION 03-20 11:54:53.064: E/AndroidRuntime(13805): FATAL EXCEPTION: AsyncServer 03-20 11:54:53.064:…
Thiago
  • 12,778
  • 14
  • 93
  • 110
0
votes
2 answers

AndroidAsync - updating views from WebSocket.StringCallback()

i'm writinig some small chat app, and i'm using AndroidAsync to get WebSocket client functionality in my application. So, the trouble is whenever i try to modify my listView from WebSocket.StringCallback().onStringAvailable(String) it causes an…
0
votes
0 answers

SocketIOClient example does not compile

I've got a Andriod Studio project and I'm trying to use the SocketIOClient from the AndroidAsync library. I'm building the library with the command: dependencies { compile 'com.koushikdutta.androidasync:AndroidAsync:1.0.0' } I was able to get…
0
votes
1 answer

Change elements on the UI thread with data received in onEvent using AndroidAsync's SocketIOClient

I can see emitted messages from the server in the Android app's console log using System.out. How do I actually use this new data to change things in my UI though? I have tried setText on a TextView that I got a handle to in onCreate. No error is…
theblang
  • 10,215
  • 9
  • 69
  • 120
0
votes
1 answer

Passing value from Android application and displaying on the console

In Mainactivity.java, I am taking signal strength from wifi 5 times and appending into a service. I pass the arraylist through Intent. I get the value through Intent in the other file. Now, I want to pass this value to java desktop server. I call…
0
votes
1 answer

Socket.io android library send method

I am trying to use a socket.io https://github.com/koush/AndroidAsync#androidasync-also-supports-socketiolibrary lib and trying to send a string using webSocket.send("a string"); by creating a new web socket using AsyncHttpClient. and sending string…
Chinmay
  • 423
  • 5
  • 19
0
votes
1 answer

Using Ion write(outputStream)

I'm not understanding how the write(outputStream) method is supposed to be used in Ion. My goal is to get an InputStream that I can feed directly into Jackson like so: Response response = Ion.with(context,…
Shane
  • 1,071
  • 6
  • 7
-1
votes
2 answers

reading data from socket - no performance

I am creating an android service which is always running and listening messages from socket. But it doesn't work with good performance and i am looking for some nio alternative or tutorial. What is the best way for listening a socket for all time ?…
dracula
  • 4,413
  • 6
  • 26
  • 31
1 2
3