websocket_easy: easy comunication between Android App and Computer or Raspeberry PI

[Total: 3    Average: 3.7/5]

This post describes a nice Android APP developed with buttons to communicate with another device (a computer or raspberry PI) using websocket.

Websocket is a communication protocol here described: https://en.wikipedia.org/wiki/WebSocket

The complete android APP is here available: https://gitlab.com/iptv-updated/websocket_easy

This APP is using the library OkHttp here described:


The APP layout (created with Android Studio) defines the events necessary to send the messages on the network with websocket. The arrows are used to send the command  “up”, “down”, “left” and “right” and the other buttons are used to provide flags and values to the server. The buttons “Loop” and “Stop-Loop” are used to activate and deactivate a server side thread. 

This client can be easily tested with the follow server developed in python:


before to execute the server the host name has to be modified to (instead of to allow the communication with all clients in the local network

here the video:



the server can also be located on Raspberry PI: this is possible using python with the library “Tornado”. 

An easy circuit has been after created on Raspberry PI with LEDs and resistors connected to GIOP. The LEDs get actions based on button pushed on Android APP.

Code to run in Raspberry PY