-
Notifications
You must be signed in to change notification settings - Fork 40
How to build TotalCross VM and SDK for Android
First things first, in order to compile a virtual machine for Android, one need to install the following requirements on your machine:
- Android SDK 28 ;
- Android NDK 17 ;
- CMake 3.5.1 or later installed (if you are building from the target platform);
- Java 11 necessarily the 11 version, not a later or earlier one;
Once you have all requirements installed will be able to build a TotalCross Virtual Machine and test.
Basically, to start building TotalCross VM and SDK for Android for testing, one just need two key elements: i) the dist/
folder which contains our .apk (by downloading a binary release of TotalCross); and ii) the etc/
folder which contains our certificates. Alternatively, if you wish to build the .apk by yourself, skip this step and continue to follow the instructions.
You must have the environment variable ANDROID_HOME
pointed to the path that has the Android SDK folder with the following structure.
.
├── build-tools
├── cmake
├── emulator
├── licenses
├── ndk
├── ndk-bundle
├── patcher
├── platforms
├── platform-tools
└── sources
As of 2021 the
ndk-bundle/
folder is no longer necessary. See more about NDK.
You just need to run the following command line inside TotalCrossVM/android/
folder:
./gradlew assembleDebug copyApk -x test
Case you decided to not use a pre-built binary .apk earlier, than do this instead
./gradlew assembleDebug -x test
The result should be something like:
.
├── LitebaseSDK/
│ └── output/
│ └── debug/
│ └── TotalCrossSDK/
├── TotalCrossSDK/
├── TotalCrossVM/
├── LICENSE
└── README.md
Copy the content of this folder must be pasted to the root of a valid SDK.