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

Overview

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(s) client/server, and WebSocket library for Android, AndroidAsync is it.

Features

  • Based on NIO. Single threaded and callback driven.
  • All operations return a Future that can be cancelled
  • Socket client + socket server
  • HTTP client + server
  • WebSocket client + server

Download

Download the latest JAR or grab via Maven:

<dependency>
    <groupId>com.koushikdutta.async</groupId>
    <artifactId>androidasync</artifactId>
    <version>(insert latest version)</version>
</dependency>

Gradle:

dependencies {
    compile 'com.koushikdutta.async:androidasync:2.+'
}

Download a url to a String

// url is the URL to download.
AsyncHttpClient.getDefaultInstance().getString(url, new AsyncHttpClient.StringCallback() {
    // Callback is invoked with any exceptions/errors, and the result, if available.
    @Override
    public void onCompleted(Exception e, AsyncHttpResponse response, String result) {
        if (e != null) {
            e.printStackTrace();
            return;
        }
        System.out.println("I got a string: " + result);
    }
});

Download JSON from a url

// url is the URL to download.
AsyncHttpClient.getDefaultInstance().getJSONObject(url, new AsyncHttpClient.JSONObjectCallback() {
    // Callback is invoked with any exceptions/errors, and the result, if available.
    @Override
    public void onCompleted(Exception e, AsyncHttpResponse response, JSONObject result) {
        if (e != null) {
            e.printStackTrace();
            return;
        }
        System.out.println("I got a JSONObject: " + result);
    }
});

Or for JSONArrays...

// url is the URL to download.
AsyncHttpClient.getDefaultInstance().getJSONArray(url, new AsyncHttpClient.JSONArrayCallback() {
    // Callback is invoked with any exceptions/errors, and the result, if available.
    @Override
    public void onCompleted(Exception e, AsyncHttpResponse response, JSONArray result) {
        if (e != null) {
            e.printStackTrace();
            return;
        }
        System.out.println("I got a JSONArray: " + result);
    }
});

Download a url to a file

AsyncHttpClient.getDefaultInstance().getFile(url, filename, new AsyncHttpClient.FileCallback() {
    @Override
    public void onCompleted(Exception e, AsyncHttpResponse response, File result) {
        if (e != null) {
            e.printStackTrace();
            return;
        }
        System.out.println("my file is available at: " + result.getAbsolutePath());
    }
});

Caching is supported too

// arguments are the http client, the directory to store cache files,
// and the size of the cache in bytes
ResponseCacheMiddleware.addCache(AsyncHttpClient.getDefaultInstance(),
                                  getFileStreamPath("asynccache"),
                                  1024 * 1024 * 10);

Need to do multipart/form-data uploads? That works too.

AsyncHttpPost post = new AsyncHttpPost("http://myservercom/postform.html");
MultipartFormDataBody body = new MultipartFormDataBody();
body.addFilePart("my-file", new File("/path/to/file.txt");
body.addStringPart("foo", "bar");
post.setBody(body);
AsyncHttpClient.getDefaultInstance().executeString(post, new AsyncHttpClient.StringCallback(){
        @Override
        public void onCompleted(Exception ex, AsyncHttpResponse source, String result) {
            if (ex != null) {
                ex.printStackTrace();
                return;
            }
            System.out.println("Server says: " + result);
        }
    });

Can also create web sockets:

AsyncHttpClient.getDefaultInstance().websocket(get, "my-protocol", new WebSocketConnectCallback() {
    @Override
    public void onCompleted(Exception ex, WebSocket webSocket) {
        if (ex != null) {
            ex.printStackTrace();
            return;
        }
        webSocket.send("a string");
        webSocket.send(new byte[10]);
        webSocket.setStringCallback(new StringCallback() {
            public void onStringAvailable(String s) {
                System.out.println("I got a string: " + s);
            }
        });
        webSocket.setDataCallback(new DataCallback() {
            public void onDataAvailable(DataEmitter emitter, ByteBufferList byteBufferList) {
                System.out.println("I got some bytes!");
                // note that this data has been read
                byteBufferList.recycle();
            }
        });
    }
});

AndroidAsync also let's you create simple HTTP servers:

AsyncHttpServer server = new AsyncHttpServer();

List<WebSocket> _sockets = new ArrayList<WebSocket>();

server.get("/", new HttpServerRequestCallback() {
    @Override
    public void onRequest(AsyncHttpServerRequest request, AsyncHttpServerResponse response) {
        response.send("Hello!!!");
    }
});

// listen on port 5000
server.listen(5000);
// browsing http://localhost:5000 will return Hello!!!

And WebSocket Servers:

AsyncHttpServer httpServer = new AsyncHttpServer();

httpServer.listen(AsyncServer.getDefault(), port);

httpServer.websocket("/live", new AsyncHttpServer.WebSocketRequestCallback() {
    @Override
    public void onConnected(final WebSocket webSocket, AsyncHttpServerRequest request) {
        _sockets.add(webSocket);
        
        //Use this to clean up any references to your websocket
        webSocket.setClosedCallback(new CompletedCallback() {
            @Override
            public void onCompleted(Exception ex) {
                try {
                    if (ex != null)
                        Log.e("WebSocket", "An error occurred", ex);
                } finally {
                    _sockets.remove(webSocket);
                }
            }
        });
        
        webSocket.setStringCallback(new StringCallback() {
            @Override
            public void onStringAvailable(String s) {
                if ("Hello Server".equals(s))
                    webSocket.send("Welcome Client!");
            }
        });
    
    }
});

//..Sometime later, broadcast!
for (WebSocket socket : _sockets)
    socket.send("Fireball!");

Futures

All the API calls return Futures.

Future<String> string = client.getString("http://foo.com/hello.txt");
// this will block, and may also throw if there was an error!
String value = string.get();

Futures can also have callbacks...

Future<String> string = client.getString("http://foo.com/hello.txt");
string.setCallback(new FutureCallback<String>() {
    @Override
    public void onCompleted(Exception e, String result) {
        System.out.println(result);
    }
});

For brevity...

client.getString("http://foo.com/hello.txt")
.setCallback(new FutureCallback<String>() {
    @Override
    public void onCompleted(Exception e, String result) {
        System.out.println(result);
    }
});
Comments
  • SSL Issues: bad_record_mac

    SSL Issues: bad_record_mac

    about: W/System.err: javax.net.ssl.SSLException: Fatal alert received bad_record_mac W/System.err: at org.apache.harmony.xnet.provider.jsse.SSLEngineImpl.unwrap(SSLEngineImpl.java:485) W/System.err: at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:383) W/System.err: at com.koushikdutta.async.AsyncSSLSocketWrapper$1.onDataAvailable(AsyncSSLSocketWrapper.java:91) W/System.err: at com.koushikdutta.async.BufferedDataEmitter.onDataAvailable(BufferedDataEmitter.java:33) W/System.err: at com.koushikdutta.async.BufferedDataEmitter.onDataAvailable(BufferedDataEmitter.java:61) W/System.err: at com.koushikdutta.async.Util.emitAllData(Util.java:20) W/System.err: at com.koushikdutta.async.AsyncNetworkSocket.onReadable(AsyncNetworkSocket.java:170) W/System.err: at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:805) W/System.err: at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:664) W/System.err: at com.koushikdutta.async.AsyncServer.access$700(AsyncServer.java:34) W/System.err: at com.koushikdutta.async.AsyncServer$14.run(AsyncServer.java:612)

    you said that forcing SSLv3 could solve it. but how do I force it? TIA

    bug 
    opened by UXDart 51
  • Gradle Error in Android Studio 0.8

    Gradle Error in Android Studio 0.8

    I added AndroidAsync as a dependency in a new project made in Android Studio 0.8. When I sync, I get this error from Gradle:

    Error:Module version com.koushikdutta.async:androidasync:1.2.6 depends on libraries but is not a library itself
    

    Here is the build.gradle for the module that is failing:

    apply plugin: 'com.android.application'
    
    repositories {
        mavenCentral()
    }
    
    android {
        compileSdkVersion 20
        buildToolsVersion "20.0.0"
    
        defaultConfig {
            minSdkVersion 9
            targetSdkVersion 20
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                runProguard false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:20.+'
        compile 'com.koushikdutta.async:androidasync:1.2.6'
        compile 'com.koushikdutta.ion:ion:1.2.7'
        compile 'de.greenrobot:eventbus:2.2.1'
    }
    
    opened by eygraber 27
  • http request returns

    http request returns "" .(May be i use it wrong)

    I use post method in this way:

    String my_way() { AsyncHttpPost httpPost = new AsyncHttpPost("URL"); httpPost.setBody(new StringBody("StringBody")); Future f = AsyncHttpClient.getDefaultInstance().executeString(httpPost); String s = f.get(); return s; }

    It returns what i want most of time. But if i call it to frequently, it results s = "".

    for(int i=0;i<10;i++) { system.out.println(my_way()); }

    results: "Right Message" "" "Right Message" "" "Right Message" "" "Right Message" "" "Right Message" ""

    I am sure that the server side is ok, because another lib has pass this test.

    It happens even i use it like this

    for(int i=0;i<10;i++) { thread.sleep(1000); system.out.println(my_way()); }

    opened by xumingthepoet 24
  • Socket.io namespacing support

    Socket.io namespacing support

    Does this android socket.io client support socket.io namespacing? I've tried to use https://github.com/koush/android-websockets but it doesn't support namespacing. And as I see SocketIOClient class doesn't change too much. So is there any way to utilize namespaces like: "ws://localhost:3000/namespace1" or to set namespace on send?

    opened by SkeLLLa 23
  • bytesConsumed is negative in SSL

    bytesConsumed is negative in SSL

    There seems to be an issue with the AsyncSSLSocketWrapper possibly feeding invalid buffers to the SSL layer. Here is the stacktrace I get:

    Caused by: java.lang.IllegalArgumentException: bytesConsumed is negative
           at javax.net.ssl.SSLEngineResult.(SSLEngineResult.java:119)
           at com.google.android.gms.org.conscrypt.OpenSSLEngineImpl.unwrap(SourceFile:455)
           at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:383)
           at com.koushikdutta.async.AsyncSSLSocketWrapper$4.onDataAvailable(SourceFile:172)
           at com.koushikdutta.async.BufferedDataEmitter.onDataAvailable(SourceFile:33)
           at com.koushikdutta.async.BufferedDataEmitter.onDataAvailable(SourceFile:61)
           at com.koushikdutta.async.Util.emitAllData(SourceFile:20)
           at com.koushikdutta.async.AsyncNetworkSocket.onReadable(SourceFile:175)
           at com.koushikdutta.async.AsyncServer.runLoop(SourceFile:758)
           at com.koushikdutta.async.AsyncServer.run(SourceFile:603)
           at com.koushikdutta.async.AsyncServer.access$700(SourceFile:37)
           at com.koushikdutta.async.AsyncServer$13.run(SourceFile:552)
    

    I have this issue on many (user) devices on Android 4.1, 4.3 or 4.4 from many manufacturers.

    opened by robUx4 22
  • WebSocket's setClosedCallback doesn't work

    WebSocket's setClosedCallback doesn't work

    First, I'd like to thank you for this amazing lib, it's impressive! I'm using it to develop a WebSocket and Socket.io plugin for Game Closure.

    I tried to use setClosedCallback and setEndCallback to handle onclose event, but these callbacks seem to be never called.

    AsyncHttpClient.getDefaultInstance().websocket(url, protocol, new WebSocketConnectCallback() {
        @Override
        public void onCompleted(Exception ex, WebSocket websocket) {
            // onopen
    
            websocket.setStringCallback(new StringCallback() {
                public void onStringAvailable(String data) {
                    // onmessage
                }
            });
    
            websocket.setClosedCallback(new CompletedCallback() {
                public void onCompleted(Exception ex) {
                    // onclose
                }
            });
    
            websocket.setEndCallback(new CompletedCallback() {
                public void onCompleted(Exception ex) {
                    // ???
                }
            });
        }
    });
    

    I have some questions about that:

    • Do I have a problem in my code or is there a bug?
    • What is the endCallback supposed to do?
    • During the closing operation, the websocket is supposed to continue to receive messages, but with this implementation, it seems to stop receiving messages just after the close statement. Is it a bug?
    • Is it possible to have the standard information that should be available with onclose event? (wasClean, code, reason)
    bug enhancement 
    opened by Godefroy 18
  • HTTPS fails with

    HTTPS fails with "connection closed before response completed" error

    Hi, I'm getting following stacktrace when I try to load file from HTTPS server:

     javax.net.ssl.SSLException: Fatal alert received handshake_failure
     at com.android.org.conscrypt.SSLEngineImpl.unwrap(SSLEngineImpl.java:484)
     at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:383)
     at com.koushikdutta.async.AsyncSSLSocketWrapper$3.onDataAvailable(AsyncSSLSocketWrapper.java:261)
     at com.koushikdutta.async.BufferedDataEmitter.onDataAvailable(BufferedDataEmitter.java:33)
     at com.koushikdutta.async.BufferedDataEmitter.onDataAvailable(BufferedDataEmitter.java:61)
     at com.koushikdutta.async.Util.emitAllData(Util.java:20)
     at com.koushikdutta.async.AsyncNetworkSocket.onReadable(AsyncNetworkSocket.java:175)
     at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:758)
     at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:603)
     at com.koushikdutta.async.AsyncServer.access$700(AsyncServer.java:37)
     at com.koushikdutta.async.AsyncServer$13.run(AsyncServer.java:552)
     com.koushikdutta.async.http.ConnectionClosedException: connection closed before response completed.
     at com.koushikdutta.async.http.AsyncHttpResponseImpl$3.onCompleted(AsyncHttpResponseImpl.java:97)
     at com.koushikdutta.async.AsyncSSLSocketWrapper.report(AsyncSSLSocketWrapper.java:519)
     at com.koushikdutta.async.AsyncSSLSocketWrapper.access$100(AsyncSSLSocketWrapper.java:30)
     at com.koushikdutta.async.AsyncSSLSocketWrapper$3.onDataAvailable(AsyncSSLSocketWrapper.java:291)
     at com.koushikdutta.async.BufferedDataEmitter.onDataAvailable(BufferedDataEmitter.java:33)
     at com.koushikdutta.async.BufferedDataEmitter.onDataAvailable(BufferedDataEmitter.java:61)
     at com.koushikdutta.async.Util.emitAllData(Util.java:20)
     at com.koushikdutta.async.AsyncNetworkSocket.onReadable(AsyncNetworkSocket.java:175)
     at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:758)
     at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:603)
     at com.koushikdutta.async.AsyncServer.access$700(AsyncServer.java:37)
     at com.koushikdutta.async.AsyncServer$13.run(AsyncServer.java:552)
     Caused by: javax.net.ssl.SSLException: Fatal alert received handshake_failure
     at com.android.org.conscrypt.SSLEngineImpl.unwrap(SSLEngineImpl.java:484)
     at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:383)
     at com.koushikdutta.async.AsyncSSLSocketWrapper$3.onDataAvailable(AsyncSSLSocketWrapper.java:261)
     ... 8 more
    

    Test code:

     private void requestWithAsync() {
            AsyncHttpClient.getDefaultInstance().executeString(new AsyncHttpGet("https://content.fastrbooks.com/android-test.txt"), new AsyncHttpClient.StringCallback() {
                @Override
                public void onCompleted(Exception e, AsyncHttpResponse response, String result) {
                    if (e != null) {
                        e.printStackTrace();
                        return;
                    }
                    Log.v("TAG",  result);
                }
            });
        }
    

    Device is Nexus 7 with stock Android 4.4.4.

    SSLv3 is not an option because server supports only TLS and cannot be reconfigured.

    opened by luhmirin-s 17
  • new error

    new error

    Hi, sorry but I have another exception, this time, it uploads up to 100% and then: it happens every time I try. the file is only 100KB. any idea what it could be? I know the server works, because there are other implementations/clients that can upload images.

                      W/System.err: javax.net.ssl.SSLException: Fatal alert received bad_record_mac
                      W/System.err: at org.apache.harmony.xnet.provider.jsse.SSLEngineImpl.unwrap(SSLEngineImpl.java:485)
                      W/System.err: at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:383)
                      W/System.err: at com.koushikdutta.async.AsyncSSLSocketWrapper$1.onDataAvailable(AsyncSSLSocketWrapper.java:91)
                      W/System.err: at com.koushikdutta.async.BufferedDataEmitter.onDataAvailable(BufferedDataEmitter.java:33)
                      W/System.err: at com.koushikdutta.async.BufferedDataEmitter.onDataAvailable(BufferedDataEmitter.java:61)
                      W/System.err: at com.koushikdutta.async.Util.emitAllData(Util.java:20)
                      W/System.err: at com.koushikdutta.async.AsyncNetworkSocket.onReadable(AsyncNetworkSocket.java:170)
                      W/System.err: at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:805)
                      W/System.err: at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:664)
                      W/System.err: at com.koushikdutta.async.AsyncServer.access$700(AsyncServer.java:34)
                      W/System.err: at com.koushikdutta.async.AsyncServer$14.run(AsyncServer.java:612)
    

    Thanks!

    opened by UXDart 16
  • Observe connections open count on AsyncHttpRequest

    Observe connections open count on AsyncHttpRequest

    I'd like to add an observer to see the queue depth on the priority queue depth in AndroidAsync. This would give me visibility into when the library was processing a request.

    opened by markshiz 15
  • Socket.IO acknowledgement

    Socket.IO acknowledgement

    Hi,

    I am looking for acknowledgment function for the socket io client, there are some socket event callback in my project need to get acknowledgement. Is this available?

    Thanks.

    opened by wonderhero 15
  • Fix leak in HybiParser

    Fix leak in HybiParser

    In strict mode, was getting warning:

    java.lang.Throwable: Explicit termination method 'end' not called at dalvik.system.CloseGuard.open(CloseGuard.java:184) at java.util.zip.Inflater.(Inflater.java:82)

    opened by elevenfive 14
  • Can not add Http Header

    Can not add Http Header

    I'm not sure if this project is still maintained, try asking.

    I have configured a proxy with authentication in my android project. There are two options to achieve

    1. extends SimpleMiddleware, and add Proxy-Authorization in the onRequest function.
    2. Call addHeader [Proxy-Authorization] in AsyncHttpRequest. Check the http message through tcpdump, it tries to connect to the target proxy, but it does not carry the [Proxy-Authorization] I added.

    I don't know if I used it wrong, attach a piece of code:

        Headers header = new Headers();
        String baseAuth = Base64.encodeToString(("test:12345678").getBytes(), Base64.NO_WRAP);
        AsyncHttpRequest.setDefaultHeaders(header, Uri.parse(url));
        header.set("Proxy-Authorization", "Basic " + baseAuth);
        AsyncHttpGet request = new AsyncHttpGet(url);
        request.setHeader("Proxy-Authorization", "Basic " + baseAuth);
        view.setText(request.toString());
        mClient.executeString(request, mCallback);
    

    If I configure this parameter in the okhttp framework, I can successfully connect. So I think there is nothing wrong with the parameters of the header.

    I checked the code of the AsyncHttp framework, I think the default does not support Proxy-Auth, so I want to manually add the http header, but it is invalid, if anyone has a suitable solution, please help me.

    opened by zll123dxd 2
  • Running websocket server in background

    Running websocket server in background

    it says that this library is single threaded, I want my websocket server to keep running even though the app is in background. Is it possible? from the source code it doesn't seem to support running the server in separate thread.

    opened by NRicode 0
  • exception when connect to server

    exception when connect to server

    when connect to web service thows this exception :

    ' FATAL EXCEPTION: AsyncServer , PID: 3343 java.lang.AssertionError at com.koushikdutta.async.AsyncSSLSocketWrapper.write(AsyncSSLSocketWrapper.java:390) at com.koushikdutta.async.AsyncSSLSocketWrapper.handleHandshakeStatus(AsyncSSLSocketWrapper.java:276) at com.koushikdutta.async.AsyncSSLSocketWrapper.handshake(AsyncSSLSocketWrapper.java:114) at com.koushikdutta.async.http.AsyncSSLSocketMiddleware.tryHandshake(AsyncSSLSocketMiddleware.java:89) at com.koushikdutta.async.http.AsyncSSLSocketMiddleware$2.onConnectCompleted(AsyncSSLSocketMiddleware.java:106) at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:849) at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:658) at com.koushikdutta.async.AsyncServer.access$800(AsyncServer.java:44) at com.koushikdutta.async.AsyncServer$14.run(AsyncServer.java:600) '

    opened by sajjadshahbazi 0
  • Callback is not received when network is poor and connection is terminated from other End

    Callback is not received when network is poor and connection is terminated from other End

    When we have used the library to connect to an backend and the signal strength is very poor and the backend has terminated the connection, we do not get call back this.socket.setClosedCallback(new CompletedCallback() { public void onCompleted(Exception var1) { } });

    opened by ManuKow 1
  •  mDataHandler failed to consume data

    mDataHandler failed to consume data

    Hello,

    i got this error: java.lang.RuntimeException: mDataHandler failed to consume data, yet remains the mDataHandler. at com.koushikdutta.async.Util.emitAllData(Util.java:39) at com.koushikdutta.async.AsyncNetworkSocket.onReadable(AsyncNetworkSocket.java:160) at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:878) at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:726) at com.koushikdutta.async.AsyncServer.access$800(AsyncServer.java:46) at com.koushikdutta.async.AsyncServer$8.run(AsyncServer.java:680)

    in my case, i called setMultipartCallback : MultipartFormDataBody body = (MultipartFormDataBody) request.getBody(); body.setMultipartCallback(part -> { DataHolder dataHolder = new DataHolder(part.getName()); body.setDataCallback(dataHolder); });

    after data arrived and completed, i called this: response.send("application/json; charset=utf-8", result); //AsyncHttpServerResponse

    can you please figure out what my mistake is?

    opened by xmuSistone 0
Owner
Koushik Dutta
Koushik Dutta
An android asynchronous http client built on top of HttpURLConnection.

Versions 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 Version 1.0.6 Description An android asynchronous http client based on HttpURLConnection. Updates U

David 15 Mar 29, 2020
A js websocket server that handle an android app that connect to the sever with a QR code, to move a red square on a webpage with the gyroscope and accelerometer

online game a js websocket server with an express server, with a mobile app. backend express is used to handle the creation page, game page and the cr

null 2 Oct 7, 2021
socket.io client with Coroutine

socket.io client with Coroutine

Heewon 12 Aug 5, 2022
Android Easy Http - Simplest android http request library.

Android Easy Http Library 繁體中文文檔 About Android Easy Http Library Made on OkHttp. Easy to do http request, just make request and listen for the respons

null 13 Sep 30, 2022
LiteHttp is a simple, intelligent and flexible HTTP framework for Android. With LiteHttp you can make HTTP request with only one line of code! It could convert a java model to the parameter and rander the response JSON as a java model intelligently.

Android network framework: LiteHttp Tags : litehttp2.x-tutorials Website : http://litesuits.com QQgroup : 42960650 , 47357508 Android网络通信为啥子选 lite-htt

马天宇 829 Dec 29, 2022
Multiplatform coroutine-based HTTP client wrapper for Kotlin

networkinkt This is a lightweight HTTP client for Kotlin. It relies on coroutines on both JS & JVM platforms. Here is a simple GET request: val text =

Egor Zhdan 31 Jul 27, 2022
Monitoring water tanker level using NodeMCU ESP8266 and HC-SR04P Ultrasonic Sensor and broadcasting it using a simple HTTP server inside NodeMCU ESP8266 and show data in an Android App

WaterLevel Preface This project aims to finding a tanker water level using NodeMCU with ESP8266 core and HC-SR04P Ultrasonic sensor and broadcasting i

YaMiN 12 Dec 20, 2022
Ktor-Client this is the client part that uses the Ktor server

Ktor-Client this is the client part that uses the Ktor server Previews Tech stack & Open source libraries Minimum SDK level 21. Kotlin+ Coroutines + F

Mohamed Emad 4 Dec 23, 2022
Easy, asynchronous, annotation-based SOAP for Android

IceSoap IceSoap provides quick, easy, asynchronous access to SOAP web services from Android devices. It allows for SOAP responses to be bound to Java

Alex Gilleran 75 Nov 29, 2022
HTTP Server for Android Instrumentation tests

RESTMock REST API mocking made easy. RESTMock is a library working on top of Square's okhttp/MockWebServer. It allows you to specify Hamcrest matchers

Andrzej Chmielewski 750 Dec 29, 2022
A gRPC Kotlin based server and client starter that builds with Gradle and runs on the JVM

gRPC Kotlin starter Overview This directory contains a simple bar service written as a Kotlin gRPC example. You can find detailed instructions for bui

Hypto 8 Sep 19, 2022
Unirest in Java: Simplified, lightweight HTTP client library.

Unirest for Java Install With Maven: <!-- Pull in as a traditional dependency --> <dependency> <groupId>com.konghq</groupId> <artifactId>unire

Kong 2.4k Jan 5, 2023
Unirest in Java: Simplified, lightweight HTTP client library.

Unirest for Java Install With Maven: <!-- Pull in as a traditional dependency --> <dependency> <groupId>com.konghq</groupId> <artifactId>unire

Kong 2.4k Dec 24, 2022
Square’s meticulous HTTP client for the JVM, Android, and GraalVM.

OkHttp See the project website for documentation and APIs. HTTP is the way modern applications network. It’s how we exchange data & media. Doing HTTP

Square 43.4k Jan 5, 2023
A type-safe HTTP client for Android and the JVM

Retrofit A type-safe HTTP client for Android and Java. For more information please see the website. Download Download the latest JAR or grab from Mave

Square 41k Jan 5, 2023
Ktorfit - a HTTP client/Kotlin Symbol Processor for Kotlin Multiplatform (Js, Jvm, Android, iOS, Linux) using KSP and Ktor clients inspired by Retrofit

Ktorfit is a HTTP client/Kotlin Symbol Processor for Kotlin Multiplatform (Js, Jvm, Android, iOS, Linux) using KSP and Ktor clients inspired by Retrofit

Jens Klingenberg 637 Dec 25, 2022
Kotlin DSL http client

Introduction Kotlin DSL http client Features ?? Developers Experience-driven library without verbosity. ?? Native way to use http client in Kotlin. ??

Sergei Rybalkin 461 Dec 13, 2022
Android Asynchronous Networking and Image Loading

Android Asynchronous Networking and Image Loading Download Maven Git Features Kotlin coroutine/suspend support Asynchronously download: Images into Im

Koushik Dutta 6.3k Dec 27, 2022