Kotlin and java versions
In this description we use connection to simple server with Bearer authorization.
Also, in this repository you can find app example written in kotlin language.
Working .net core SignalR server.
implementation 'com.smartarmenia:dotnetcoresignalrclientjava:1.14'
or (for Android Studio 2.x)
compile 'com.smartarmenia:dotnetcoresignalrclientjava:1.14'
For alpha version
private val connection: HubConnection = WebSocketHubConnection("http(https)://hubaddress/", "Bearer your_token")
For preview2-final version
private val connection: HubConnection = WebSocketHubConnectionP2("http(https)://hubaddress/", "Bearer your_token")
connection.addListener(listener)
connection.subscribeToEvent(event, listener)
connection.connect()
Invoke method
connection.invoke("Method", params...)
For alpha version
final HubConnection connection = new WebSocketHubConnection("http(https)://hubaddress/", "Bearer your_token");
For preview2-final version
final HubConnection connection = new WebSocketHubConnectionP2("http(https)://hubaddress/", "Bearer your_token");
connection.addListener(listener);
connection.subscribeToEvent(event, listener);
connection.connect();
Invoke method
connection.invoke("Method", params...);
If you get Multidex... error on compile, clean and rebuild project
If you want to participate in this project or have proposals, ideas or wishes, please create issue.