Android Websockets Support

I am going to launch a project for a client with a lot of data, which should be in real time.

There are two mobile applications that I will create using trigger.io, as well as a web interface, and all of them must remain in sync.

I plan to use the socket.io WebSocket implementation with my Node.js file for web and mobile applications. This is great for iOS and modern web browsers.

However, Android web browsing does not support websites at all. And it will simply destroy the data plan of users of mobile applications if socket.io used its long-term rollback on Android.

I was wondering: is there any possibility of implementing Java WebSockets for trigger.io Android and then exposing this to a WebView? There is a simple implementation for a telephone conversation

I believe that I could write a trigger.io plugin for it, but I want to be sure before moving on to this project if it is possible / not too difficult to write a plugin.

I used trigger.io for a long time, but not so, because all the quirks came out as native plugins.

+8
source share
1 answer

If using a fail-safe HTTP solution is not an option (I would do some calculations to determine if a streaming or long-term solution really “breaks the mobile user data plan”), then the best solution for adding WebSocket support is probably the trigger.io plugin.

At Pusher, we used the Java wrapper in PhoneGap to make our JavaScript library work. However, since then we have added an HTTP reserve, so I would not recommend that anyone use this now. The project is here: https://github.com/pusher/pusher-phonegap-android

The problem with the Java shell here (we use websocket-android-phonegap ) is that it does not support SSL connections (if I remember correctly), and it has not been updated for a long time.

With this in mind, when we created the Pusher Java library (which supports Android), we used the WebSocket client in Java-WebSocket , because it is actively developing and supports SSL connections. I would recommend it.

I would be interested to know about support https://github.com/mkuklis/phonegap-websocket .

+4
source share

All Articles