Logo Banner

K8055 - [REMOTING] - [Control by Android]

Remote Controlling

Method 4: Control by Android Smartphone

I recently started learning how to create software (Apps) for Android Smartphones. When people start learning a new programming environment, they usually start with a basic 'Hello World' app. This is a program that simply outputs a message on the screen: It allows a developer to become familiar with the new programming environment. Immediately after building my first 'Hello World' app, I added a button that could transmit a network command to my K8055 card. The remote control was born.

I have now created a complete demonstration program with 8 buttons. Each of the buttons controls an output of the K8055 card. The project consists of two parts: a smartphone app and a Windows server program. Both are communicating using the UDP-protocol.

The K8055 Server

The K8055 server is the software that controls the K8055. It is written in Visual Basic .NET and must be installed on computer your K8055 is connected to. This computer needs a Windows operating system. The software should be compatible with most versions of Windows (XP, 7, 8).

The server program will create a listening UDP port. The default port is 12345. Once the server enabled it starts listening for incoming UDP commands, coming from a remote Android phone/tablet. These devices might be connected to your local home network using WiFi, but it should also work over a 3G connection.

Many home computers are behind a router/firewall that are blocking incoming traffic. They might block any incoming traffic from your Android device. If this is the case you might need to disable the firewall, or create a special firewall rule that specifies traffic from your device might pass through.

The Android App

Please be aware the Android app is only a demonstration of the possibilities to control K8055 with your smartphone. It shouldn't be used for real K8055 applications. The application is not available on Google Play.

My demonstration Android app needs to be installed on your Android phone. The application has 8 buttons to control the K8055 card. Each time you click a button, a request is sent to the server. This request is sent by means of an unencrypted UDP packet (datagram), meaning:

As I mentioned before, the App is currently not available on Google Play. There are two reasons for this: I don't want to encourage people to use a insecure app to control their K8055. But I also need to learn more about Android-development before I start publishing real applications... Of course there is always the possibility to test my App if you really want to: the download section of this page offers a ZIP with the complete project: source files + executable files. The ZIP also contains an .APK installer to install the App on your Phone, without using Google Play.

The app doesn't need any special Android access permissions, other than the Internet-permission. This permission is needed to send UDP-packets over the network (WiFi/3G).

The communication protocol

The communication protocol is very easy: the server creates an UDP listening port. The default port is 12345. Now any remote client can send UDP-commands to the server. The server will check if the command has the required format, and execute it:

	SEND 00000000

A command contains the word SEND, followed by 8 binary numbers: 1 or 0. Each number represents an output of the K8055 card. The server will then switch the outputs of the K8055.

The future

this project was created for demonstration purposes. It shouldn't be used for real K8055 applications. Please contact me if you are interested in this project. I am willing to improve the project if there is enough interest for it:

Download Source

Both source and executable are available for this project. Click the button to download the complete project.

Copyright ©1998-2022 Vanderhaegen Bart - last modified: January 01, 2015