{"id":18739596,"url":"https://github.com/springmeyer/hello-android-ndk","last_synced_at":"2026-02-24T07:06:31.575Z","repository":{"id":14254901,"uuid":"16962429","full_name":"springmeyer/hello-android-ndk","owner":"springmeyer","description":"Sample Android JNI application demonstrating cross compiling and linking external library","archived":false,"fork":false,"pushed_at":"2014-02-18T23:48:07.000Z","size":128,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-28T18:28:23.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/springmeyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-18T20:21:24.000Z","updated_at":"2024-01-24T08:18:25.000Z","dependencies_parsed_at":"2022-07-10T05:31:17.220Z","dependency_job_id":null,"html_url":"https://github.com/springmeyer/hello-android-ndk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springmeyer%2Fhello-android-ndk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springmeyer%2Fhello-android-ndk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springmeyer%2Fhello-android-ndk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springmeyer%2Fhello-android-ndk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springmeyer","download_url":"https://codeload.github.com/springmeyer/hello-android-ndk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239619570,"owners_count":19669447,"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","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":[],"created_at":"2024-11-07T15:36:26.718Z","updated_at":"2025-10-28T22:03:37.123Z","avatar_url":"https://github.com/springmeyer.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## Hello world example for Android NDK + JNI app\n\n## Depends\n\n  - OSX host\n  - Android r9c NDK (for building app)\n  - Android ADT Bundle (for running app)\n  - Ant\n\n\n## Setup\n\nFirst install `ant`:\n\n    brew install ant\n\nSetup the NDK and environment for cross-compiling against NDK:\n\n    curl -O http://dl.google.com/android/ndk/android-ndk-r9c-darwin-x86_64.tar.bz2\n    tar -xf android-ndk-r9c-darwin-x86_64.tar.bz2\n    export NDK_PATH=$(pwd)/android-ndk-r9c\n    # see all API levels at $NDK_PATH/platforms/\n    export API_LEVEL=\"android-19\"\n    # see all compiler options at $NDK_PATH/toolchains/\n    export ANDROID_CROSS_COMPILER=\"arm-linux-androideabi-clang3.3\"\n    export PLATFORM_PREFIX=\"${NDK_PATH}/active-platform/\"\n    # NOTE: make-standalone-toolchain.sh --help for options\n    \"${NDK_PATH}/build/tools/make-standalone-toolchain.sh\"  \\\n      --toolchain=\"${ANDROID_CROSS_COMPILER}\" \\\n      --install-dir=\"${PLATFORM_PREFIX}\" \\\n      --stl=gnustl \\\n      --arch=arm \\\n      --platform=\"${API_LEVEL}\"\n\nSetup the ADK:\n\n    curl -O http://dl.google.com/android/adt/adt-bundle-mac-x86_64-20131030.zip\n    unzip adt-bundle-mac-x86_64-20131030.zip\n    ADT_BUNDLE=\"$(pwd)/adt-bundle-mac-x86_64-20131030\"\n    export PATH=\"${ADT_BUNDLE}/sdk/tools:${ADT_BUNDLE}/sdk/platform-tools\":${PATH}\n\nNow build the JNI app:\n\n    cd hello-android-ndk/app\n    $NDK_PATH/ndk-build\n    \n    # create a build.xml\n    $ADT_BUNDLE/sdk/tools/android update project -p ./ --target 1 --subprojects\n    ant debug\n\n    # list available a virtual devices\n    $ADT_BUNDLE/sdk/tools/android list avd\n    \n    # create a virtual device named 'Phone'\n    $ADT_BUNDLE/sdk/tools/android create avd -n Phone -t 1\n\n    # in another terminal start the simulator\n    # be prepared to wait a while for it to start up\n    $ADT_BUNDLE/sdk/tools/emulator @Phone \u0026 $ADT_BUNDLE/sdk/tools/ddms\n    \n    # then back in the main terminal install to test on the app\n    # Note: this will not work until the emulator is fully running\n    $ADT_BUNDLE/sdk/platform-tools/adb install -r bin/MainActivity-debug.apk\n\nTODO: describe cross compiling external library\n\n    #alias ldd=\"arm-linux-androideabi-readelf -d \"\n    #export PATH=\"${PLATFORM_PREFIX}/bin\":${PATH}\n    #export CXX=\"arm-linux-androideabi-g++\"\n    #export CC=\"arm-linux-androideabi-gcc\"\n    #export LD=\"arm-linux-androideabi-ld\"\n    #export AR=\"arm-linux-androideabi-ar\"\n    #export RANLIB=\"arm-linux-androideabi-ranlib\"\n    # TODO - some builds hardcode libtool which breaks since os x version is used (zlib)\n    #alias libtool=\"arm-linux-androideabi-ar cru\"\n    #export libtool=\"arm-linux-androideabi-ar cru\"\n    #export NM=\"arm-linux-androideabi-nm\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringmeyer%2Fhello-android-ndk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringmeyer%2Fhello-android-ndk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringmeyer%2Fhello-android-ndk/lists"}