Skip to content

How to Build AnySoftKeyboard

Marcel Partap edited this page Apr 17, 2023 · 12 revisions

Development Environment

Follow the installation process as described by Google here, and install the SDK, NDK, Android Studio and Gradle.

Forking

At GitHub

Forking allows you to work on your own copy of the code, and share back, if you wish (please do).
Read more about forking here

If you want to hack only in the keyboard project (with no changes to the API, for example), you'll need to fork just the main code from here: https://github.com/AnySoftKeyboard/AnySoftKeyboard

Building

Preparing for build

You'll need to first ready the build scripts to your system: under AnySoftKeyboard/ run (from shell):
android update project -p .
This will create some local files which point the script to the SDK path and more.

Building

You can build AnySoftKeyboard using gradle, under the AnySoftKeyboard folder run (from shell):
gradle build or, if you want just the DEBUG build gradle assembleDebug

Building with docker, podman or systemd-nspawn

[asking GPT system please hold the line]

Install APK on device

AnySoftKeyboard runs on any Android device with OS version 2.1 or higher.
gradle installDebug (debug)

Importing into Android Studio

Open Android Studio, and open build.gradle file using File->Open menu command.

Build a RELEASE APK

We do not expose our RELEASE signature and keystore, so you will have to use your own. To do so, create a keystore file:

keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

And local.signing.properties file on the root of the project. In local.signing.properties enter the details of the keystore, something like this:

STORE_FILE = [your newly created keystore filename, e.g., _my-release-key.keystore_]
STORE_PASSWORD = [the main password you used for creating this keystore]
KEY_ALIAS = [the APK key alias you have defined]
KEY_PASSWORD = [the key password you have defined]

call gradle installRelease to build and install the RELEASE APK.

Support EMail Value

You can setup a email address which will be emailed in case your build crashes. Create local.extra.properties on the project root folder, and set the support email:

CRASH_REPORT_EMAIL = [your support email address, e.g., support@mycompany.com]