Mobile live synchronization (eg Trello): sockets? - android

I was wondering how live synchronization mechanisms such as the one used by Trello work.
For example when I move a card from the website, the board is immediately refreshed on the iPhone too. As Push Notifications are not reliable, I suppose a sort of open connection/socket stream is used under the hood.
socket.io quotes Trello among its users: does anyone have any reference about Trello's mobile implementation?
Thanks,
DAN

Trello uses a combination of WebSockets and polling to perform instant updates. Most clients use WebSockets all the time; the few that don't support WebSockets use short HTTP polling instead. It also uses a single HTTP poll to "catch up" after losing a WebSocket connection and reconnecting.
The iOS and Android apps connect using socket.io clients that are locked down to only the WebSocket transport. The web client uses raw WebSockets. On the backend, socket.io is used only to support the handshake and protocol expected by the iOS/Android apps; all of the pubsub/message routing is custom.

I've no excact documentation about Trello but some ideas:
You could use Wireshark, Charles or Fiddler to monitor the network traffic between your iDevice and Trello.
Socket.io is a very nice thing and could be used with iOS (see here). It should be possible to live update a view with socket.io

Related

Is there a way to set up a kafka server on Android?

My goal is to feed a NN on Android with real time streaming events from various data sources (sensors, other servers). I have created a working set up on a linux server with Kafka to explore the concept. Replicating this set up to an Android device poses the question if this is the correct architecture for a mobile device as well, or if I should go for a completely different approach.
Kafka on Android does not work (server especially, but client neither), and is not recommended due to required network connections.
More commonly, MQTT is used for streaming mobile and IOT sensor devices (which could in-turn send data to Kafka at the backend, collection site)

Firebase XMPP Protocol Vs HTTP Protocol

Currently I am planning to use Firebase Cloud Messaging with my Android and IOS APP.
In Firebase there are two type of protocol HTTP and XMPP, so my question is when to use which protocol. In which scenario which protocol performs the best.
Thank you all in advance.
From what source you have got that Firebase does not work in emulator!! I am developing an app using genymotion emulator and it works good. Also about HTTP and XMPP what protocol you use depending on the server you will be using. HTTP is simple to use and a lot of people go with it while XMPP is complicated to implement on the device and server as well.
But XMPP may be harder it supports downstream and upstream messages means you can also send a message from a device to your server. But XMPP is good as it does not take a lot of charge and battery.
But nearly everyone use HTTP. And implement upstream messages by your own implementation!!
IMO this does not matter a lot pick the one which u feel more comfortable with.
Only thing I can state is that XMPP is protocol created for communication so if your notifications consist of short frequent messages pick this one, otherwise pick HTTP, which is more commonly used
Sincerely I have experience just with HTTP and it works really well
According to my view, use HTPP. because XMPP requires HTTP more than HTPP requires XMPP.
XMPP is an open standard technology protocol used to presence indicator and instant messaging, while for HTTP had good features and the same time it works better than XMPP.

Which transport will be used by SignalR between android app and IIS server that supported Websocket?

I want to write an android application and I want to know if SignalR use websocket or something else for communicating between server and client, before I do that.
Anybody know?
By default, SignalR will try to work with web sockets, if they are not available in the underlying platform, it will fall back to SSE, and then to long polling.
Xamarin/Mono current implementation has some issues with web sockets, even though SignalR supports it, so web sockets will not be available.
If your app is made with Xamarin (as you tagged your question), the best protocol you will get is SSE (server sent events). But in my experience (I´ve got an app working with it) this protocol is fast and stable enough for most use cases.
From the signalR webpage
SignalR uses the new WebSocket transport where available, and falls
back to older transports where necessary.
From the Xamarin forums and youtube, It seems people have successfully implemented websocket transport with SignalR on Android
What else can I use?
Socket.IO for an HTML5 application(With NodeIIS),GCM or Firebase like push notifications for native on any webserver

native app to server communication

I am writing a mobile trading app (android/ios) and i need suggestions on the best way to connect the app to the server (messageQ)
If i use raw TCP connection , would my users have a problem if they are behind corporate wifi's (protected by firewalls)? If yes, in that case, is web socket a better solution?
With the backend server, after researching with zeroMq, i believe a full fledged broker like rabbitmq is a better option to start with. Now , if i use a web socket connection from my native app, Rabbit MQ has a sockJS-AMQP bridge . But i am not sure, if there is a java and iOS web socket client to speak to sockJS server .
Any experienced views is greatly appreciated
Have you considerer to use MQTT?
If you don't need AMQP you can also use directly an MQTT broker, such as http://mosquitto.org/ or http://www.hivemq.com/
Here (https://github.com/owntracks) you can find some ready libraries for iPhone and Android.
In order to solve the the firewall problem MQTT is available over HTTP.
You can read here:
http://www.hivemq.com/mqtt-over-websockets-with-hivemq/
or
here http://mqtt.org/wiki/doku.php/mqtt_over_websockets
This post can also help you : (https://www.ibm.com/developerworks/community/blogs/sowhatfordevs/entry/using_mqtt_protocol_advantages_over_http_in_mobile_application_development5?lang=en)
For a iPhone application I used directly MQTT and as server RabbitMQ with the MQTT plug-in
http://www.rabbitmq.com/mqtt.html
I hope it can be useful 

Android app, open connection to to mobile devices

what is the best way to create a two way constant communication between a server and an android app?
When I say constant communication, I mean client asking server for data or server constantly pushing data to clients.
From what I saw, I can't use websockets since they are designer for server/browser setups. Is that right? If so, what is the alternative?
Is there free frameworks to work with this in Android?
What I am trying to do is an application that works like a chatting but for multiple people. So they all will get in one "room or channel" on their devices, and then interact with each other, in a way handdled by the server.
Thanks!
As far as I know , one possible way is using a web service where the client can connect to the server , if the web service is RESTFul there are many libraries to access it , one of them is the apache HTTPClient , for the server pushing the only way I know is C2DM for pushing data to clients.
For continuously-open data connection, you may use Sockets. But you should also consider the fact that an always-open connection will drain your battery quickly too. For more details, read this and this
You may want to look at AutobahnAndroid:
https://github.com/tavendo/AutobahnAndroid
which provides native Android/Java WebSocket client framework (plus WAMP = PubSub/RPC over WebSocket .. http://wamp.ws).
This is fully interoperable with WebSocket servers that server browser clients.
The AutobahnXX libraries (where XX = Python, JS, Android) are Open-Source (Apache 2.0). We (Tavendo) are offering a commercial virtual appliance based on Autobahn: http://autobahn.ws
Disclaimer: I am author of Autobahn and work for Tavendo.
But keeping the connection running on the background on iOS and Android devices does drain the battery, for people who have this issue, I suggest using push notifications when the app is not on the foreground.
From what I saw, I can't use websockets since they are designer for
server/browser setups. Is that right? If so, what is the alternative?
Websocket is an IETF/W3C protocol, so it is not confined to a specific client platform. You can use Android websocket to get a two-way communication between Android and server side. For Android websocket client, I recommend using AndroidAsync. It has all websocket API that you need to establish the communication link and exchange data between Android and the server.

Categories

Resources