Indeed, a company called Tavendo, which focuses on real-time data, has an open source framework, called Autobahn, which implements WebSocket on Android (and many others). It is then certainly capable of speaking WebSocket.
AndroidĬlearly, Android is capable of speaking raw sockets, HTTP, and much more. But this does not have to happen just at the server, it can also happen from other clients that implement WebSocket. In fact, many server applications do (message brokers for example), and more regularly add support. One could effectively build a telnet client using WebSocket, if the target server knew WebSocket.Īn interesting aspect of this is that since WebSocket is a standard, there is nothing prohibiting a server from implementing that handshake. WebSocket can handle not only textual content, but also binary content. This is called the "handshake".Īt that point, the WebSocket connection stays open (as opposed to a traditional HTTP request that is closed after the response). Assuming the web server knows what to do with that request, it is then "upgraded" to a WebSocket. When opening a WebSocket from the browser, the initial contact with the server is an HTTP request. WebSocket is an interesting topic not only because of the real-time capabilities is can bring to your application, but also because of how it functions.
#Android web server arduino how to
In this post, I will show you how to create a native Android application that uses the same WebSocket server to participate in a chat with the browser.
Since WebSocket is an open standard however, we can talk to more than just the browser (despite the name). With the help of a little Node.js on the server, and a browser in hand, we were able to create a functional chat program. In a previous post, I talked about hosting a WebSocket server on IBM Bluemix.