Results 1 to 4 of 4
  1. #1

    PhoneGap Android Build LightStreamer client switching to HTTP-POLLING ?


    i setup a LightStreamer client all is working 100% fine in the web browser either desktop or mobile iOS etc but now when testing it via Android either in web browser or PhoneGap build the client is connected via HTTP-POLLING when normally it would be CONNECTED:WS-STREAMING i cannot subscribe to the stream anymore.. so i have used the setForcedTransport option ( which works on desktop and iOS devices when i force set it to either "WS-STREAMING" or "HTTP-POLLING" but now when i force set the Android to "WS-STREAMING" please see my code snippet below it says CONNECTING for a few seconds then switches to DISCONNECTED please can you let me know what is going on?

    client = new LightstreamerClient("","ADAPTER");             
    client.connectionOptions.setConnectTimeout(10000); // this makes no difference 

  2. #2
    Senior Member
    Join Date
    Feb 2013
    Hi Kurt,

    The ability to use websockets depends on the system browser on the mobile phone.
    On Android the system browser does not support websockets, so, neither as a PhoneGap app, nor as a webapp on the system browser, your app will be able to connect using websockets.
    You may use Chrome browser, which supports websockets, to enable your webapp to use them.
    You may find more details on this article [ ] (see section "Hey! What about Websockets?").
    By the way, if your application does mainly receive data, there is no big difference using websockets instead of HTTP streaming. The real advantage using websockets arise if the client too sends many messages and the traffic is almost bidirectional.
    So, it's correct your app on Androids is not able to use websockets, but you mention your app fallbacks to "HTTP-POLLING", while instead should use HTTP STREAMING. Please check again if it is using HTTP-POLLING instead of HTTP STREAMING, and in this case, try to look into the server logs to see if you can find any reason why it is not able to use HTTP STREAMING, or send us a snippet of the logs.


  3. #3
    What is the major difference in using web sockets instead of HTTP streaming?
    Also: I've been using the LightStreamer SDK (my Android project), but recently I noticed that when I use the Proguard rules, the data update from LlightStreamer isn't performed. What can be the issue?
    Edit: my previous reply didn't appear.

  4. #4
    Join Date
    Feb 2012
    Hi Terry,

    Indeed there are potential issues when minifying with proguard an application based on the "full" version of LS Android SDK library.
    We suggest excluding the class names from minification, as some parts of the library use Java reflection in a way that proguard may not detect.
    We suggest adding the following restrictions in (though narrower restrictions are certainly possible):

    -keep class io.netty.** { *; }
    -dontwarn io.netty.**
    -keep class com.lightstreamer.** { *; }
    -dontwarn com.lightstreamer.**

    If small footprint is very important in your case, you can also consider the "compact" version of the LS Android SDK library.
    See the library overview for details (





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT +1. The time now is 12:47 AM.