{"id":29948480,"url":"https://github.com/retifrav/android-cpp-example","last_synced_at":"2026-05-10T05:11:39.017Z","repository":{"id":220817358,"uuid":"752664682","full_name":"retifrav/android-cpp-example","owner":"retifrav","description":"An example of using a C++ library inside Android application with Kotlin","archived":false,"fork":false,"pushed_at":"2024-02-24T15:55:06.000Z","size":3752,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-01T21:33:00.932Z","etag":null,"topics":["android","cpp","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/retifrav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":["retifrav"]}},"created_at":"2024-02-04T13:20:48.000Z","updated_at":"2024-02-04T13:40:40.000Z","dependencies_parsed_at":"2024-02-09T20:26:35.229Z","dependency_job_id":"39863c12-7ace-4121-a14f-682b0a4baf0b","html_url":"https://github.com/retifrav/android-cpp-example","commit_stats":null,"previous_names":["retifrav/android-cpp-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/retifrav/android-cpp-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retifrav%2Fandroid-cpp-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retifrav%2Fandroid-cpp-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retifrav%2Fandroid-cpp-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retifrav%2Fandroid-cpp-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retifrav","download_url":"https://codeload.github.com/retifrav/android-cpp-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retifrav%2Fandroid-cpp-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268512163,"owners_count":24261889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","cpp","kotlin"],"created_at":"2025-08-03T08:16:53.630Z","updated_at":"2026-05-10T05:11:38.987Z","avatar_url":"https://github.com/retifrav.png","language":"Kotlin","funding_links":["https://github.com/sponsors/retifrav"],"categories":[],"sub_categories":[],"readme":"# Android C++ example\n\nAn example of using a pre-built C++ library in Android application with Kotlin.\n\nMore details in the [following article](https://decovar.dev/blog/2024/02/12/cpp-library-in-android-application/).\n\n\u003c!-- MarkdownTOC --\u003e\n\n- [Building C++ library](#building-c-library)\n- [Running Android application](#running-android-application)\n\n\u003c!-- /MarkdownTOC --\u003e\n\n## Building C++ library\n\n``` sh\n$ cd ./cpp\n$ mkdir build \u0026\u0026 cd $_\n\n$ export ANDROID_NDK_VERSION='25.1.8937393'\n$ export ANDROID_NDK_HOME=\"$HOME/Library/Android/sdk/ndk/$ANDROID_NDK_VERSION\"\n\n$ echo $VCPKG_ROOT\n\n$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\" \\\n    -DCMAKE_TOOLCHAIN_FILE=\"$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake\" \\\n    -DVCPKG_TARGET_TRIPLET=\"arm64-android-v8a-v30\" \\\n    -DVCPKG_OVERLAY_TRIPLETS=\"/ABSOLUTE/PATH/TO/cpp/misc/vcpkg/triplets\" \\\n    -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=\"${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake\" \\\n    -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=30 \\\n    ..\n$ cmake --build . --target install\n\n$ cp -an ./vcpkg_installed/arm64-android-v8a-v30/* ../install/\n$ ls -L1 ../install/\n```\n\n## Running Android application\n\n1. Open `./android` folder in Android Studio;\n2. Set `CMAKE_PREFIX_PATH` to `/ABSOLUTE/PATH/TO/cpp/install` in `./android/app/build.gradle.kts`;\n3. Make/build the project or just click `Run 'app'`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretifrav%2Fandroid-cpp-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretifrav%2Fandroid-cpp-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretifrav%2Fandroid-cpp-example/lists"}