-
Notifications
You must be signed in to change notification settings - Fork 24
Building
Before building a GTK-based application for Android, you should:
-
download and install Android Studio/SDK;
-
download and install Android NDK;
-
pull the latest sources from this repo;
-
run
python clibs/getLibs.py
. This command downloads all the necessary library sources from their original locations. (On Windows Python2.7 can be found inside NDK distribution: %NDK_ROOT%/prebuilt/windows-x86_64/bin/python2.7.exe.)
Now you can build a test application sitting in "app" subdirectory.
Replace it with your own code, or modify your Android.mk
to look like:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := <your module name>
LOCAL_SRC_FILES := <your sources> (see app/jni/main.c for example)
include <path to GTKAndroid snapshot>/clibs/gtk/build-gtk-shared-library.mk
To build this demo application run:
cd app
ndk-build NDK_DEBUG=1
../gradlew assembleDebug
Skip NDK_DEBUG=1
and assembleDebug
for the release version.
To install the application use the usual
adb install -r build/outputs/apk/app-debug.apk
If you do everything right, you should be able to see something like the following screenshot on your phone/tablet