The Spiel screen reader for the Android operating system is an open source project, so anyone can independently modify and compile its sources, subject to the provisions of the Apache 2.0 license .

Unfortunately, the documentation of the project leaves much to be desired, and some materials on the official wiki often do not correspond to the current state of affairs at all, including in the part where the code building process is described.

This article will describe the process of compiling the Spiel distribution from source codes in the correct presentation at the time of this writing (February 2012, Spiel 1.2.0 source). It should be borne in mind that over time, the algorithm may undergo certain changes, mainly in relation to the required versions of the tools used. At the same time, it will be possible to clarify them in the service information of the project files.

In general, the whole process can be conditionally divided into four stages:

  1. Installing and configuring the development environment for Android OS
  2. Additional configuration for working with the Scala programming language
  3. Getting the Spiel Source Codes
  4. Directly executing the build of the code into a working distribution

Installing and configuring the development environment

It should only be noted that at the time of writing, Spiel requires the Android 2.2 API, and the current version of ProGuard does not support the Java compiler file format from the latest JDK versions, so we recommend installing JDK 6u30.

In addition, for the correct call of the javac.exe file from other programs, you should add the directory of its location to the path variable, for example, for Windows:

C: \ Program Files \ Java \ jdk1.6.0_30 \ bin

Additional customization

Spiel uses Scala as its development language. Therefore, to work with its source code, you need to install the corresponding additional components. In the Spiel project, this task is performed by the SBT build system in the form of the sbt-launch Java loader.

At the time of this writing, sbt-launch version 11.1 should be used to build Spiel code , which uses sbt-android-plugin 0.6.0.

The operating system-specific sbt-launch installation procedure can be clarified on the SBT Build System Installation and Getting Started Guide page .

For example, for Windows, the sbt-launch.jar file should be placed in the directory specified in the Path variable, and a batch file “sbt.bat” should be created there with the following content:

set ANDROID_SDK_HOME = C: \ droid \ android-sdk
set PATH = C: \ droid \ android-sdk;% PATH%
set SCRIPT_DIR =% ~ dp0
java -Xmx512M -jar "% SCRIPT_DIR% sbt-launch.jar"% *

Instead of “C: \ droid \ android-sdk” in the PATH environment variable and the ANDROID_SDK_HOME value, specify the path to the directory where the Android SDK is installed.

Download Spiel Source Codes

For the development of Spiel, the Fossil version control system is used . After downloading the version for the operating system of interest, place the executable file in the directory specified in the Path variable.

To download the source code from the Spiel repository, run the command in the working directory (assuming that the user is working in the command interpreter’s console window)

fossil clone http://spielproject.info spiel.fossil

This will load the spiel.fossil file, which is a packed data packet, into the current directory. To unpack it, run the command

fossil open spiel.fossil

After that, the source files of the project will appear in the working directory, with which you can already work.

Compiling the program

If at the previous stages all actions were performed correctly, then to build the code, it is enough to execute the command in the directory with Spiel files

sbt android: package-debug

To rebuild –

sbt ~ android: package-debug

If an Android device is connected to the computer, then the assembled distribution kit can be immediately installed directly on it. To do this, use the command

sbt android: install-device

In this case, if the Spiel program is already installed on the device, then it will be automatically updated.

In the working directory, the compiled file appears along the path “\ target \ spiel-xxx.apk”, where “xxx” is the number of the compiled version.

Other possible problems and their solutions

  • The sbt-launch.jar loader exits with an error when the username contains non-Latin characters. Therefore, the assembly of the code should be carried out from under the accounts, whose names consist exclusively of Latin letters.
  • The sbt.launch.jar can be blocked by the system firewall when this downloader contacts a remote repository to download the necessary components. In such situations, you should either temporarily disable the firewall or allow sbt-launch access to the network.
  • The Spiel distributions assembled by the described method do not have a security certificate, therefore, to install them in the device menu, you must first perform the following action: Settings> Applications> check the Unknown sources checkbox.

Leave a Reply

Your email address will not be published. Required fields are marked *