Welcome to Nubomedia-VTT jsonrpc-ws-android’s documentation!

Contents:

Readme

This project is part of NUBOMEDIA www.nubomedia.eu

jsonrpc-ws-android

The repository contains documentation for installing and utilising the jsonrpc-ws-android library for Android. The repository contains description of the the jsonrpc-ws-android library and also the source code of the jsonrpc-ws-android implementation.

Third-party libraries

This repository consists of an Android Studio library project. The project uses the following third-party libraries:

https://github.com/nubomedia-vtt/utilities-android
https://github.com/TooTallNate/Java-WebSocket
http://software.dzhuvinov.com/json-rpc-2.0-base.html

Developers Guide

This documents provides information how to utilize the jsonrpc-ws-android library for your project.

Setup the developing environment by importing the project to Android Studio. If you want to build the project from source, you need to import the third-party libraries via Maven by adding the following lines to the module’s build.gradle file

Android application code

import java.net.URI;
import fi.vtt.nubomedia.jsonrpcwsandroid.JsonRpcNotification;
import fi.vtt.nubomedia.jsonrpcwsandroid.JsonRpcRequest;
import fi.vtt.nubomedia.jsonrpcwsandroid.JsonRpcResponse;
import fi.vtt.nubomedia.jsonrpcwsandroid.JsonRpcWebSocketClient;
import fi.vtt.nubomedia.utilitiesandroid.LooperExecutor;

JsonRpcWebSocketClient client = null;
LooperExecutor executor = null;
JsonRpcWebSocketClient.WebSocketConnectionEvents eventHandler = null;

URI uri = new URI("ws://web_socket_url");
client = new JsonRpcWebSocketClient(uri, eventHandler ,executor);

/* connect */
executor.execute(new Runnable() {
  public void run() {
    client.connect();
  }
});

/* send message */
JsonRpcRequest request = new JsonRpcRequest();
HashMap<String, Object> namedParameters = ...;
Integer id = new Integer(1);
String method = "myMethod";

request.setId(id);
request.setMethod(method);
request.setNamedParams(namedParameters);

executor.execute(new Runnable() {
  public void run() {
    client.sendRequest(request);
  }
});


/* disconnect */
executor.execute(new Runnable() {
  public void run() {
    client.disconnect(false);
  }
});

Source code is available at https://github.com/nubomedia-vtt/jsonrpc-ws-android

Support is provided through the Nubomedia VTT Public Mailing List available at https://groups.google.com/forum/#!forum/nubomedia-vtt

Installation Guide

This documents provides information how to utilize jsonrpc-ws-android library in your project.

Setup the developing environment by importing the project to Android Studio. Import the third-party libraries via Maven by adding the following lines to the module’s build.gradle file

compile 'fi.vtt.nubomedia:jsonrpc-ws-android:1.0.4'

This repository is licensed under a BSD license available at https://github.com/nubomedia-vtt/jsonrpc-ws-android/blob/master/LICENSE

Support is provided through the Nubomedia VTT Public Mailing List available at https://groups.google.com/forum/#!forum/nubomedia-vtt

License

Nubomedia jsonrpc-ws-android is distributed as Open Source Software basing BSD-license available at: https://github.com/nubomedia-vtt/jsonrpc-ws-android/blob/master/LICENSE