This Android library enables any Android application to communicate bidirectionally with the Lightstreamer Server. The API allows to subscribe to real-time data delivered directly by the server or routed via mobile push notifications, and to send any message to the server.
The library exposes a fully asynchronous API. All the API calls that require any action from the library itself are queued for processing by a dedicated thread before being carried out. The same thread is also used to carry notifications for the appropriate listeners as provided by the custom code. Blocking operations and internal housekeeping are performed on different threads.
The library offers automatic recovery from connection failures, automatic selection of the best available transport, and full decoupling of subscription and connection operations. The subscriptions are always meant as subscriptions "to the LightstreamerClient", not "to the Server"; the LightstreamerClient is responsible of forwarding the subscriptions to the Server and re-forwarding all the subscriptions whenever the connection is broken and then reopened.
The library also offers support for mobile push notifications (MPN). While real-time subscriptions deliver their updates via the client connection, MPN subscriptions deliver their updates via push notifications, even when the application is offline. They are handled by a special module of the Server, the MPN Module, that keeps them active at all times and continues pushing with no need for a client connection. However, push notifications are not real-time, they may be delayed by the service provider (FCM) and their delivery is not guaranteed.
The library is available in two versions: "compact" and "full". The "compact" version leans on the basic JDK's HTTP implementation and has a smaller footprint at the cost of a few limitations. The most important limitation is that WebSockets are not available in the "compact" version. Moreover, the "compact" version of the library relies on the JDK's "sun.net.http.retryPost" system property to be set as false before the first use of JDK's HTTP implementation, to ensure full compliancy with HTTP specifications. The library will set the property as soon as possible, but, to avoid conflicts, the application should also set the property at its own startup.
Start digging into the API from the