1703 Commits

Author SHA1 Message Date
Dan Albert
65e4ae2dae Point at DAC instead of duplicating docs.
We have the more refined version of this information on DAC now.
2025-10-03 15:47:15 -07:00
Dan Albert
6906ad32da Remove audio samples in favor of Oboe's repo.
We shouldn't be recommending OpenSLES any more, and we don't need Oboe
samples because Oboe's own samples are much more thorough than ours will
ever be.
2025-10-03 15:43:55 -07:00
Dan Albert
cc2621e279 Expand documentation for native-activity sample.
This expands the docs and comments in the native-activity sample to be
something closer to a proper guide. There isn't a very clear flow to it
since the documentation is necessarily spread out into multiple files,
and sometimes the order of the code requires explaining things out of
order, but it's better than nothing.

If we wanted to turn this into an actual guide that could be written in
a clear order without duplicating code snippets into the docs, which
would surely be quickly out of date, we could use something like sphinx
(possibly through readthedocs) to generate something closer to a
literate code sample.
2025-10-03 14:19:12 -07:00
Dan Albert
371c261c86 Remove obsolete screenshot.
This screenshot is no longer accurate, and I don't think it's useful
anyway, so I'm deleting it rather than updating it.
2025-10-03 14:19:12 -07:00
Dan Albert
aa52693f43 Remove obsolete, duplicate, and useless docs.
License text, setup instructions, and support info do not need to be
duplicated into every README, since they're already in the top-level
README. They were originally in each sample because the samples used to
each be separate Android Studio projects with different requirements
that could be checkout out independently in Android Studio. This is no
longer the case.

Most of the docs also included text along the lines of "This sample uses
the new Android Studio with CMake support", which hasn't been new since
2015, so doesn't really need to be said.

The prerequisites were mostly not true. Android Studio is not required
for any of this. Cloning the repo and running `./gradlew build` is
sufficient to build all the samples. They also were not being kept
up-to-date at all, since they mostly said "Android Studio 2.2 or newer",
which was definitely not true. I'm not what the oldest version of
Android Studio that will work here is, but I don't actually test
anything but the latest so claiming anything otherwise is just
misleading.

I haven't pruned or edited any of the real content of the docs. I'm sure
there are plenty of edits to be made there and a lot of expansion to do,
but those changes will be less mechanical and will happen separately.
2025-09-25 20:41:14 +00:00
Dan Albert
59791f25df Add (and require) version scripts for everything. 2025-09-23 18:45:09 +00:00
Dan Albert
77557fb73e Add overlooked JNI method to RegisterNatives. 2025-09-23 12:31:30 +00:00
Dan Albert
1ee099f9f7 Document the reason for using RegisterNatives. 2025-09-22 20:33:11 +00:00
Dan Albert
a8cd972f7e Migrate camera/basic to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
63739c1903 Migrate unit-test to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
032d6b90f0 Migrate choreographer-30fps to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
3e09643345 Migrate sensor-graph to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
554ee59871 Migrate sanitizers to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
32ae6dd47a Migrate orderfile to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
8055c540b6 Migrate native-midi to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
a20a509ab2 Migrate native-codec to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
d106f32d44 Migrate native-audio to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
857aaf8c5c Migrate hello-oboe to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
b5f4723a4a Migrate hello-jniCallback to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
e2acdc3ee9 Migrate hello-jni to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
959bb0ad70 Migrate hello-gl2 to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
abbd095638 Migrate gles3jni to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
61196249b7 Migrate exceptions to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
44e223b4ae Migrate camera/texture-view to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
8085d6c12d Migrate bitmap-plasma to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
9b34a2ee5d Migrate audio-echo to RegisterNatives. 2025-09-22 20:28:34 +00:00
Dan Albert
c0c80cef49 Simplify native_app_glue uses.
These should all just move to GameActivity, but that's a slightly more
involved migration. This is an easy first step to clean up the existing
callers.
2025-09-18 21:10:28 +00:00
Dan Albert
5dd0e384fe Increase warning level in unit-test. 2025-09-18 00:34:31 +00:00
Dan Albert
4cbc8c4abf Increase warning level in textured-teapot.
And fix the bug that the warning found, where loading the texture image
would fail if the read couldn't complete in a single call.
2025-09-17 23:59:21 +00:00
Dan Albert
431d0f4a22 Increase warning level in more-teapots. 2025-09-17 23:59:21 +00:00
Dan Albert
f457ffa9fc Increase warning level in classic-teapot. 2025-09-17 23:59:21 +00:00
Dan Albert
9e3341b165 Increase warning level in image-decoder. 2025-09-17 23:59:21 +00:00
Dan Albert
b5dc046a28 Increase warning level in choreographer-30fps. 2025-09-17 23:59:21 +00:00
Dan Albert
d55c85d6f4 Increase warning level in teapots/common/ndk_helper.
I'm ignoring the deeper questions of why some of these seemingly
important arguments are unused because this whole directory is destined
for the scrap heap, but until I've actually finished writing that new
merged graphics sample, this will stick around.
2025-09-17 23:59:21 +00:00
Dan Albert
e1dd22594d Remove unhelpful prefab samples.
These don't demonstrate any NDK behavior, just AGP behavior. The
dependency management they show is also shown elsewhere since we rely on
these features for sharing code between samples anyway.
2025-09-17 23:57:35 +00:00
Dan Albert
6df22d6fef Increase warning level in orderfile sample. 2025-09-17 23:55:22 +00:00
Dan Albert
ceb0acc5e8 Increase warning level in sanitizers sample.
It's a little bit strange to do this in a sample that's intentionally
doing bad things, but not *these* wrong things, so it's still helpful to
move the sample to `add_app_library` so we can apply consistent
behaviors throughout the repo.
2025-09-17 23:54:58 +00:00
Dan Albert
0a3d7e2ecd Cleanup santiizers CMakeLists.txt.
Remove all the boiler plate comments and pointless find_library
indirection for liblog.
2025-09-17 23:54:58 +00:00
Dan Albert
7308e9c8d2 Increase warning level in sensorgraph. 2025-09-17 23:51:11 +00:00
Dan Albert
fa71ca4019 Update the native-activity README.
I changed what this sample does but forgot to update the docs.
2025-09-17 23:11:18 +00:00
Dan Albert
3d0e23ed75 Remove san-angeles sample.
This is just another OpenGL sample, and a very old one at that. It
wasn't even originally written for Android, but was ported from asm to
OpenGL for desktop and now this is the Android port (though it still
includes the win32 code!). It's also not doing anything useful that the
other GL samples aren't.
2025-09-17 22:59:41 +00:00
Dan Albert
c890b01187 Add READMEs to the deleted samples directories.
It's not perfect because any stale links people follow that link to
anything but this README will still be a 404, but it's at least
something people can find if they walk up the dead link to the top of
the sample's directory.
2025-09-17 20:51:26 +00:00
Dan Albert
c2c70d4364 Remove native-plasma.
This is just native-activity with extra steps.

Fixes https://github.com/android/ndk-samples/issues/1139.
2025-09-17 20:51:04 +00:00
Dan Albert
d5f29a739f Simplify native-activity graphics code.
We don't need OpenGL just to do a color fill. Save that for the OpenGL
samples. Replace that with a trivial AHardwareBuffer based color fill.

I've altered the old animation which didn't really work the way I think
it was intended to. It looks like someone had intended for the
accelerometer to alter the color, but it actually only animated between
black and bright green. I've removed the sensor code as superfluous
anyway, so just do something simpler: switch from red, to green, to blue
every second. I kept some amount of animation rather than just clearing
a solid color because if we only draw once and have no update cycle then
choreographer and most of the event handling code also becomes useless,
and without that the sample no longer bears any resemblance to a real
app.

https://github.com/android/ndk-samples/issues/1139
2025-09-17 20:51:04 +00:00
Dan Albert
556e6041fd Remove useless comments. 2025-09-17 20:51:04 +00:00
Dan Albert
11d93063e4 Remove pointless sensor code from native-activity.
We already have a separate sensor-graph sample. There's no need to
complicate this NativeActivity hello world with accelerometer logspam.

https://github.com/android/ndk-samples/issues/1139
2025-09-17 20:51:04 +00:00
Dan Albert
f03dfd8068 Remove Neural Networks samples.
This API is deprecated in favor of TFLite:
https://developer.android.com/ndk/guides/neuralnetworks/migration-guide.
TFLite has their own docs and samples, and isn't an NDK API anyway so we
don't need to replace these samples with TFLite samples. Just delete the
thing we're recommending against so people don't get confused into
following bad advice.
2025-09-17 18:54:56 +00:00
Dan Albert
28e7d7bf57 Remove native-media sample.
This is essentially an OpenMAX AL duplicate for native-codec. OpenMAX AL
isn't deprecated, but it's not recommended either. I'm removing the
sample because new code should prefer to use the NDK Media Codec APIs as
shown in the native-codec sample.
2025-09-17 18:54:12 +00:00
Dan Albert
caa7866a0c Add missing project to native-codec.
I'd missed this one somehow when I fixed all the others. Add it to shut
up the warning.
2025-09-16 00:04:48 +00:00
Dan Albert
fff222e9b4 Increase warning level in native-audio. 2025-09-16 00:02:24 +00:00