UCI and XBoard Protocols for Android

UCI engine on an HTC HD2 with Android (photo courtesey Thorsten Czub)
[HTC]
UCI engine on Aart's Nexus One (complete 3-4-5-piece Nalimov on 8GB SD card)
[HTC]
The Universal Chess Interface (UCI) was designed by Stefan Meyer-Kahlen and Rudolf Huber as an open interface between a chess engine and a chess GUI. The interface allows chess programmers to focus on writing the chess engine, leaving details such as board setup and play, clock and notation display, and possibly opening book and root-level endgame tablebases play to the GUI. Examples of programs on Windows, Linux, and Mac OS with UCI engine support are Arena, ChessBase Fritz, Lucas Chess, and Sigma Chess. Since August 2010, Chess for Android provides UCI support on the Android platform.

The Chess Engine Communication Protocol (often simply called the XBoard or WinBoard protocol), designed by Tim Mann and H.G.Muller, provides an alternative protocol between chess engines and a chess GUI. In October 2011, Chess for Android added support for the XBoard protocol as well.

Android Development

Applications for the Android platform (mainly ARMv5TE-based devices, although x86-based devices are emerging as well) can be developed in several ways. (1) Most development for Android is done using the Android SDK and the Java programming language. An application is compiled into bytecode that runs on the Dalvik Virtual Machine, making this approach the most portable (it runs on ARMv5TE and x86, as well as on possible future architectures). Because bytecode interpretation has lower performance than native code, Android 2.2 (aka Froyo) introduced the Dalvik JIT compiler, which translates bytecode into native code right before execution for a speed boost. The Chess for Android GUI and its built-in engine are implemented using this first approach, and ship as a single package. (2) Alternatively, developers that want higher performance can use the Android NDK to write performance-critical portions in C/C++, which is compiled into native code (ARMv5TE and/or x86). Those native components are then embedded through JNI in a regular Android application that is developed with the SDK. In this second approach, the bytecode and native components still ship as a single package. (3) Finally, developers can do all development in C/C++ and generate stand-alone native code using the appropriate compiler toolchain (e.g. CodeSourcery for ARM or the toolchain that ships with the NDK). This third approach is used by Chess for Android to import engines that do not ship with the application. Users can first get Chess for Android from the market, and later install third party engines from any other (possibly private) source.

Importing UCI and XBoard Engines in Chess for Android

Before UCI and XBoard engines can be imported in Chess for Android they first must be installed in internal memory as follows (note that Chessbase compatible engines that are installed in other applications on the same device do not have to be installed at all; such engines are directly available for import): To actually import an engine in Chess for Android for game play, go to the UCI and XBoard submenu again, but now pick Import Engine and select the appropriate engine from the list of installed engines. If the import is successful, a window pops up with the engine name and author to indicate that the built-in Java chess engine now has been replaced by the imported engine (exiting the application unloads the engine). Some screenshots are shown below. Also see the Chess for Android Manual.

[UCI0] [UCI1] [UCI2] [UCI3] [UCI4] [UCI5]


Please note that this page is privately maintained by Aart Bik. LinkedIn