Skip to content

Commit

Permalink
Improve the README.
Browse files Browse the repository at this point in the history
Some of this is quite old. Links to YouTube videos from 2015 and
websites that don't exist any more aren't so useful. Update and
rearrange.

Still lacking is an ARCHITECTURE.md that explains the repo layout. I'll
do that next.
  • Loading branch information
DanAlbert committed May 13, 2024
1 parent b8a54f8 commit 69c06e9
Showing 1 changed file with 41 additions and 44 deletions.
85 changes: 41 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,61 @@
# NDK Samples
# Android NDK Samples

[![build](https://github.com/android/ndk-samples/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

Expand All @@ -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

0 comments on commit 69c06e9

Please sign in to comment.