{"id":26818316,"url":"https://github.com/googlesamples/android-ndk","last_synced_at":"2025-03-30T05:01:35.875Z","repository":{"id":32145842,"uuid":"35718695","full_name":"android/ndk-samples","owner":"android","description":"Android NDK samples with Android Studio","archived":false,"fork":false,"pushed_at":"2025-01-08T19:01:33.000Z","size":54408,"stargazers_count":10228,"open_issues_count":23,"forks_count":4213,"subscribers_count":619,"default_branch":"main","last_synced_at":"2025-03-25T18:06:41.739Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://developer.android.com/ndk","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/android.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2015-05-16T10:02:15.000Z","updated_at":"2025-03-25T12:48:25.000Z","dependencies_parsed_at":"2025-01-21T04:00:43.995Z","dependency_job_id":"33234f3f-7fdc-41df-a943-670545fc39f8","html_url":"https://github.com/android/ndk-samples","commit_stats":{"total_commits":817,"total_committers":93,"mean_commits":8.78494623655914,"dds":0.7674418604651163,"last_synced_commit":"03e7823f9e806d6feee47e210381b8f0643e1323"},"previous_names":["googlesamples/android-ndk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android%2Fndk-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android%2Fndk-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android%2Fndk-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android%2Fndk-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/android","download_url":"https://codeload.github.com/android/ndk-samples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246277352,"owners_count":20751549,"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":"2025-03-30T05:01:15.565Z","updated_at":"2025-03-30T05:01:35.849Z","avatar_url":"https://github.com/android.png","language":"C++","readme":"# Android NDK Samples\n\nThis repository contains sample apps that use the [Android NDK].\n\nFor an explanation of the layout of this repository, see\n[ARCHITECTURE.md](ARCHITECTURE.md).\n\n## Build and run\n\n[![build](https://github.com/android/ndk-samples/actions/workflows/build.yml/badge.svg)](https://github.com/android/ndk-samples/actions)\n\n1. Clone the repository\n2. Open the whole project in Android Studio\n3. Select the sample you want to run in the top bar (you may need to sync gradle\n   first)\n4. Click the play button to run the sample\n\nYou can also build the samples from the command line if you prefer. Use\n`./gradlew build` to build everything (if you're on Windows, use `.\\gradlew.bat`\ninstead of `./gradlew`). For individual tasks, see `./gradlew tasks`. To see the\ntasks for an individual sample, run the `tasks` task for that directory. For\nexample, `./gradlew :camera:basic:tasks` will show the tasks for the\n`camera/basic` app.\n\n## I just want something to copy from as a starting point\n\nThe samples in this repository are generally not a good starting point for a\nproduction quality app. They aim to demonstrate individual NDK APIs, but often\nmake sacrifices to be succinct that make them unsuitable for a production app.\nThis is gradually changing, but for now you should not do this.\n\n[Now in Android](https://github.com/android/nowinandroid/) is an excellent\nresource for production quality apps in general, but does not touch on NDK-\nspecific issues. https://github.com/DanAlbert/ndk-app-template can help some\nwith that until this repository is able to.\n\nYou're most likely best served by using the New Project wizard in Android Studio\nto create a new app, then using those resources and the samples here as a\nreference. Android Studio's \"Native C++\" template is a good starting point for\ntypical applications that need to use some C++ via JNI. The \"Game Activity\"\ntemplate is a good starting point for game-like apps (that is, apps that do not\nuse the Android UI, but instead render their own UI using OpenGL or Vulkan).\n\n## Additional documentation\n\n- [Add Native Code to Your Project](https://developer.android.com/studio/projects/add-native-code.html)\n- [Configure NDK for Android Studio/Gradle Plugin](https://developer.android.com/studio/projects/configure-agp-ndk)\n- [CMake for NDK](https://developer.android.com/ndk/guides/cmake.html)\n\n## Support\n\nIf you've found an issue with a sample and you know how to fix it, please\n[send us a PR!](CONTRIBUTING.md).\n\nIf you need to report a bug, where it needs to be filed depends on the type of\nissue:\n\n- Problems with the samples themselves:\n  https://github.com/googlesamples/android-ndk/issues\n- Problems with the OS APIs: http://b.android.com (usually the Framework\n  component)\n- Problems with NDK (that is, the compiler):\n  https://github.com/android/ndk/issues\n\nFor questions about using the NDK or the platform APIs, you can ask on:\n\n- [The NDK mailing list](https://groups.google.com/g/android-ndk) (best if\n  you're not sure where else to ask)\n- The [Discussions](https://github.com/android/ndk-samples/discussions) tab of\n  this repo (best for questions about the samples themselves)\n- The NDK's [Discussions](https://github.com/android/ndk/discussions) (best for\n  questions about the NDK compilers and build systems)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/android)\n\n## Additional NDK samples:\n\n- [Google Play Game Samples with Android Studio](https://github.com/playgameservices/cpp-android-basic-samples)\n- [Google Android Vulkan Tutorials](https://github.com/googlesamples/android-vulkan-tutorials)\n- [Android Vulkan API Basic Samples](https://github.com/googlesamples/vulkan-basic-samples)\n- [Android High Performance Audio](https://github.com/googlesamples/android-audio-high-performance)\n\n## License\n\nCopyright 2018 The Android Open Source Project, Inc.\n\nLicensed to the Apache Software Foundation (ASF) under one or more contributor\nlicense agreements. See the NOTICE file distributed with this work for\nadditional information regarding copyright ownership. The ASF licenses this file\nto you under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at\n\nhttps://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\n[LICENSE](LICENSE)\n\n[Android NDK]: https://developer.android.com/ndk\n","funding_links":[],"categories":["Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglesamples%2Fandroid-ndk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglesamples%2Fandroid-ndk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglesamples%2Fandroid-ndk/lists"}