| .. | ||
| KMAPro | ||
| KMEA | ||
| Samples | ||
| .editorconfig | ||
| .gitignore | ||
| build.sh | ||
| history.md | ||
| README.md | ||
Keyman for Android & Keyman Engine for Android
Minimum Android Requirements
Keyman for Android has a minSdkVersion of 15 for Android 4.0.3 Ice Cream Sandwich
Setup Android Studio
- Download Android Studio and install with these instructions.
- For Windows users, set environment variable ANDROID_HOME to the location of your Android SDK. The default installation location is C:\Users\[USER]\AppData\Local\Android\sdk where [USER] is your username. You may need to log out and log back in to take effect.
For MacOS/Linux users, add the following to ~/.bashrc or ~/.bash_profile
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
- For Windows users, from a Git Bash Prompt window, cd to the sdk/tools/bin folder and accept all the SDK license agreements
yes | ./sdkmanager.bat --licenses
- If you plan to test on a physical device via USB, install the appropriate OEM USB drivers
- Install Java SE Development Kit
Keyman for Android Development
Keyman for Android (formerly named KMAPro) can be built from a command line (preferred) or Android Studio.
Compiling From Command Line
- Launch a command prompt
- Change to one of these directories depending on what you want to compile:
- For compiling KMEA and KMAPro, cd to the directory keyman/android
- For compiling only KMAPro, cd to the directory keyman/android/KMAPro
./build.sh- The APK will be found in KMAPro/kMAPro/build/outputs/apk/kMAPro-*.apk
Compiling From Android Studio
- Ensure that Keyman Engine for Android is built.
- Launch Android Studio and import the Gradle project keyman/android/KMAPro/build.gradle
- From the project view, configure anything that Gradle reports.
- Create a run configuration for kMAPro i. Select Run --> Edit Configurations... ii. Select Add New Configuration (+) --> Android App iii. Change Module to kMAPro iv. Name your run configuration kMAPro (or as desired)
- Run your new configuration: Select Run --> Run 'kMAPro'
- Select a physical device or create a new virtual device to match your target API version
Running From Command Line
- Launch a command prompt
- cd to the $ANDROID_HOME/tools directory
- Ensure that a physical device is connected or an emulator is running.
i. To list physical devices:
adb devicesii. To list created emulator devices:emulator -list-avdsiii. Create a new virtual device if there are no existing devices. iv. Start an emulator:emulator @nameofemulator - Load the APK:
adb install -r path/to/apk.apki. If multiple devices are connected you may needadb install -r -s SERIAL path/to/apk.apk. ReplaceSERIALwith the device serial number listed in step 3.
Sample Projects
There are two included sample projects that can be modified to test a keyboard.
android/Samples/KMSample1 app runs a bare Keyman app for testing a keyboard.
android/Samples/KMSample2 app provides prompts for setting KMSample2 as a system level keyboard. Both sample apps include a default Tamil keyboard.
Building these projects follow the same steps as KMAPro:
- Build KMEA
- cd to the desired KMSample directory
./build.sh- Open Android Studio to run the app
How to Build Keyman Engine for Android
- Open a terminal or Git Bash prompt and go to Keyman Engine for Android project folder (e.g.
cd ~/keyman/android/KMEA/) - Run
./build.sh
Keyman Engine for Android library (keyman-engine.aar) is now ready to be imported in any project. A copy can be found at android/Samples/KMSample1/app/libs/keyman-engine.aar.
How to Use Keyman Engine for Android Library
- Copy keyman-engine.aar into [Your project folder]/app/libs/ folder.
- Open your project in Android Studio.
- Open build.gradle (Module: app) in "Gradle Scripts".
- include
compile(name:'keyman-engine', ext:'aar')in dependencies. - after dependencies, insert
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
- include
import com.tavultesoft.kmea.*;to use Keyman Engine in a class.