Android Application

Preface

To develop a mobile application for Android phones, Google provides a free, full-blown IDE called Android Studio. Android uses Java language, so if you are accustomed with it, it's a matter of understanding the life cycle of an application and put together some layouts to start programming!

Work files links

Full Android Studio project for Mobile Application
iScore.zip

Overview and User Interface

During the late nights spent trying to complete the assignment before the weekly deadline, one night I stumbled across the movie Tron Legacy and I was fascinated by the graphics, the lights and the futuristic looks it had. So I wanted to take inspiration from those for the User Interface of my Android Application.

The first step was to look for background images and techniques to replicate the same look and feel. After enough patching, trimming, colouring and puzzling I came up with some backgrounds, popups and overall interface I was happy with.

One of the most useful and worth mentioning features of Android Studio, is called 9-patch image files. Using 9-patches, it's possible to create nice interfaces that adapt to the actual dimension and resolution of the screen without stretching of pixelating.

Eventually, I had my interface programmed and ready to be used:


Bluetooth Communication Protocol

The communication between the Android App and the scoreboard is really simple. Once the connection is established, the application sends a packet via Bluetooth everytime an event occurs on the User Interface, like a score update (touch on the score points), an inversion of the field (touch on the button in the top center) or a time-out request (touch on the '30' number button), etc.

At the moment, there are 2 kind of packets:

  • Score update

    This packet is sent everytime a change is performed on the user interface, so that the scoreboard can update accordingly.
    It's a 16 bytes array with those fields:

    • StartOfPacket: constant value 0x40
    • Command: constant value 0x55
    • TeamID: value 0x41 for Team A, value 0x42 for Team B
    • Color: 3 bytes for RGB color (1 byte each channel)
    • Score: current set score value for Team ID
    • Set: set value for Team ID
    • TeamID: value 0x41 for Team A, value 0x42 for Team B
    • Color: 3 bytes for RGB color (1 byte each channel)
    • Score: current set score value for Team ID
    • Set: set value for Team ID
    • EndOfPacket: constant value 0x23

    The field CRC is not currently used, but provided for future implementation

  • Time-out

    This packet is sent everytime a time-out is requested for one of the teams, so that the scoreboard can show the countdown accordingly.
    It's a 4 bytes array with those fields:

    • StartOfPacket: constant value 0x40
    • Command: constant value 0x54
    • RemainingTime: value of remaining seconds of time-out
    • EndOfPacket: constant value 0x23

    The field CRC is not currently used, but provided for future implementation