This is a simple Android application written in C that displays "Hello, World!" using raylib for graphics rendering.
Before you begin, ensure you have the following installed:
- Android SDK
- Android NDK
- CMake: Version 3.5 or higher for building the project.
- Build System: Ninja is recommended for faster builds.
- Java Development Kit (JDK)
- raylib: Download and build raylib for Android following the instructions in the raylib documentation.
Before building the project, ensure the following environment variables are set:
-
ANDROID_HOME: Path to the Android SDK installation.
-
ANDROID_EXTERNAL_HOME: Path to the installation of external Android libraries. This directory must have the following structure:
ANDROID_EXTERNAL_HOME/ ├── include/ # Contains header files for external libraries │ └── raylib.h # Raylib header files └── lib/ # Contains library files for different ABIs ├── <ABI>/ # ABI name (e.g., armeabi-v7a, arm64-v8a) │ └── libraylib.a # Raylib static library for the specified ABI
-
KEYSTORE_FILE: Path to the keystore file used for signing the APK.
-
KEYSTORE_PASS: Password for the keystore.
-
KEY_PASS: Password for the signing key within the keystore.
Replace placeholders with your values and execute the commands:
-
Configure the project:
cmake -B <Build-Directory> \ -DCMAKE_TOOLCHAIN_FILE=<NDK-Path>/build/cmake/android.toolchain.cmake \ -DANDROID_ABI=<ABI> \ -DANDROID_PLATFORM=<API-Level>
Parameters:
- Build Directory: Name of the build directory (e.g.,
Build/arm64-v8a
). - NDK Path: Path to the Android NDK installation.
- ABI: Target Application Binary Interface (e.g.,
arm64-v8a
,armeabi-v7a
). - API Level: Minimum Android API level to support (e.g.,
android-21
).
- Build Directory: Name of the build directory (e.g.,
-
Build the project:
cmake --build <Build-Directory>
This command compiles the native code and generates the APK.
-
Install on a connected device:
To install the APK on a connected device, run:
cmake --build <Build-Directory> --target install_apk
-
Clean: Clean all output files (including binaries and APKs)
cmake --build <Build-Directory> --target clean
-
Uninstall APK: Remove the app from the connected device.
cmake --build <Build-Directory> --target uninstall_apk
-
Check Device ABI: Confirm the ABI of the connected device.
cmake --build <Build-Directory> --target check_device_abi
-
List Users on Device: Get a list of users configured on the device.
cmake --build <Build-Directory> --target list_users
This project is licensed under the MIT License.