diff --git a/README.md b/README.md index fe2f311e1..58ea3a0c4 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,61 @@ -# NDK Samples +# Android NDK Samples [![build](https://github.com/android/ndk-samples/actions/workflows/build.yml/badge.svg)](https://github.com/android/ndk-samples/actions) -This repository contains [Android NDK][0] samples with Android Studio -[C++ integration](https://www.youtube.com/watch?v=f7ihSQ44WO0&feature=youtu.be). +This repository contains sample apps that use the [Android NDK]. -These samples use the new -[CMake Android plugin](https://developer.android.com/studio/projects/add-native-code.html) -with C++ support. +## Build and run -Samples could also be built with other build systems: +1. Clone the repository +2. Open the whole project in Android Studio +3. Select the sample you want to run in the top bar (you may need to sync gradle + first) +4. Click the play button to run the sample -- for ndk-build with Android Studio, refer to directory - [other-builds/ndkbuild](https://github.com/googlesamples/android-ndk/tree/master/other-builds/ndkbuild) -- for gradle-experimental plugin, refer to directory other-builds/experimental. - Note that gradle-experimental does not work with unified headers yet: use NDK - version up to r15 and Android Studio up to version 2.3. When starting new - project, please use CMake or ndk-build plugin. +You can also build the samples from the command line if you prefer. Use +`./gradlew build` to build everything (if you're on Windows, use `.\gradlew.bat` +instead of `./gradlew`). For individual tasks, see `./gradlew tasks`. To see the +tasks for an individual sample, run the `tasks` task for that directory. For +example, `./gradlew :camera:basic:tasks` will show the tasks for the +`camera/basic` app. -Additional Android Studio samples: - -- [Google Play Game Samples with Android Studio](https://github.com/playgameservices/cpp-android-basic-samples) -- [Google Android Vulkan Tutorials](https://github.com/googlesamples/android-vulkan-tutorials) -- [Android Vulkan API Basic Samples](https://github.com/googlesamples/vulkan-basic-samples) -- [Android High Performance Audio](https://github.com/googlesamples/android-audio-high-performance) - -Documentation +## Additional documentation - [Add Native Code to Your Project](https://developer.android.com/studio/projects/add-native-code.html) -- [Configure NDK for Android Studio/Gradle Plugin](https://github.com/android/ndk-samples/wiki/Configure-NDK-Path) +- [Configure NDK for Android Studio/Gradle Plugin](https://developer.android.com/studio/projects/configure-agp-ndk) - [CMake for NDK](https://developer.android.com/ndk/guides/cmake.html) -Known Issues - -- For Studio related issues, refer to - [Android Studio known issues](http://tools.android.com/knownissues) page -- For NDK issues, refer to [ndk issues](https://github.com/android/ndk/issues) +## Support -For samples using `Android.mk` build system with `ndk-build` see the -[android-mk](https://github.com/googlesamples/android-ndk/tree/android-mk) -branch. +If you've found an issue with a sample and you know how to fix it, please +[send us a PR!](CONTRIBUTING.md). -## Build Steps +If you need to report a bug, where it needs to be filed depends on the type of +issue: -- With Android Studio: "Open An Existing Android Studio Project" or "File" > - "Open", then navigate to & select project's build.gradle file. -- On Command Line: set up ANDROID_HOME and ANDROID_NDK_HOME to your SDK and NDK - path, cd to individual sample dir, and do "gradlew assembleDebug" +- Problems with the samples themselves: + https://github.com/googlesamples/android-ndk/issues +- Problems with the OS APIs: http://b.android.com (usually the Framework + component) +- Problems with NDK (that is, the compiler): + https://github.com/android/ndk/issues -## Support +For questions about using the NDK or the platform APIs, you can ask on: -For any issues you found in these samples, please +- [The NDK mailing list](https://groups.google.com/g/android-ndk) (best if + you're not sure where else to ask) +- The [Discussions](https://github.com/android/ndk-samples/discussions) tab of + this repo (best for questions about the samples themselves) +- The NDK's [Discussions](https://github.com/android/ndk/discussions) (best for + questions about the NDK compilers and build systems) +- [Stack Overflow](https://stackoverflow.com/questions/tagged/android) -- submit patches with pull requests, see [CONTRIBUTING.md](CONTRIBUTING.md) for - more details, or -- [create bugs](https://github.com/googlesamples/android-ndk/issues/new) here. +## Additional NDK samples: -For Android NDK generic questions, please ask on -[Stack Overflow](https://stackoverflow.com/questions/tagged/android), Android -teams are periodically monitoring questions there. +- [Google Play Game Samples with Android Studio](https://github.com/playgameservices/cpp-android-basic-samples) +- [Google Android Vulkan Tutorials](https://github.com/googlesamples/android-vulkan-tutorials) +- [Android Vulkan API Basic Samples](https://github.com/googlesamples/vulkan-basic-samples) +- [Android High Performance Audio](https://github.com/googlesamples/android-audio-high-performance) ## License @@ -80,4 +77,4 @@ specific language governing permissions and limitations under the License. [LICENSE](LICENSE) -[0]: https://developer.android.com/ndk +[Android NDK]: https://developer.android.com/ndk