33 Commits

Author SHA1 Message Date
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
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
5c283e26bc clang-format the world.
This used to be done by CI but we ripped that out since there wasn't any
good way to ensure that CI and and local workflows were using the same
clang-format. Back when it was in CI, the pointer alignment was
configured incorrectly (we used the Google style presets, but those are
alignment preserving rather than actually style enforcing). Reformat
everything since the .clang-format file has changed since then so I stop
including so many unrelated edits in my commits.
2025-08-27 10:51:31 -07:00
Dan Albert
4a872ea46a Fix all missing project warnings.
CMake really wants us to include this for some reason. I'm not sure why,
but it's easy enough to shut up.
2025-08-25 05:03:03 -07:00
Dan Albert
b8a54f86a6 Update CMake behaviors.
The version here is like Android's targetSdkVersion: it controls bug
compatibility sorts of things. Bump it up to the CMake version we're
using so we get the modern behaviors.
2024-05-13 11:49:42 -07:00
Dan Albert
aeb6178117 Migrate nn-samples to convention plugin. 2024-05-09 15:00:23 -07:00
Dan Albert
87b1ece9ac Remove unused gradle stuff in child projects.
None of these are used now that the top level one exists.

https://github.com/android/ndk-samples/issues/1010
2024-05-09 13:36:59 -07:00
Dan Albert
9ccb9a9b44 Remove cruft from samples build.gradle files.
This has been cargo culted forward in each sample for who knows how
long. Most of these don't use kotlin or the library plugin.

The clean task bit I think was a workaround for a very old AGP bug that
was in the new app templates, but if I create a new project with AS now,
it's no longer included.
2024-05-07 13:01:14 -07:00
Dan Albert
8dd34185ff Run upgrade assistant on all samples.
Not quite all. I skipped the other-builds directory because 'tis a silly
place that needs to just be merged with the core samples properly as a
build variant rather than being a distinct project.
2024-05-06 18:39:07 -07:00
James Farrell
e73d5df22b Add mdformat pre-commit, and format all markdown. (#921) 2022-12-13 13:55:06 -06:00
James Farrell
a6da74a7aa Update org.jetbrains.kotlin.android plugin to 1.7.21 (#914) 2022-12-07 13:45:28 -06:00
James Farrell
251b6506dd Remove cmake version from build.gradle. (#911) 2022-12-07 13:15:05 -06:00
James Farrell
6674b592b2 Clang format (#908) 2022-12-06 20:05:58 -06:00
James Farrell
2da8c881cb Upgrade all obsolete dependencies. (#903)
androidx.appcompat:appcompat:1.5.1
androidx.constraintlayout:constraintlayout:2.1.4
androidx.core:core:1.9.0
com.android.support.constraint:constraint-layout:2.0.4
com.google.oboe:oboe:1.6.1
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21
org.jetbrains.kotlin:kotlin-stdlib:1.7.21
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1
2022-12-05 12:26:22 -06:00
James Farrell
9823089d1c Make gradle-wrapper.properties consistent everywhere. (#900) 2022-12-01 14:33:16 -06:00
James Farrell
b16b7b615d Fix lint errors for nn-samples. (#892)
`./gradlew lint` reports no issues.
2022-11-30 14:00:31 -06:00
James Farrell
10439ab363 Upate gradle files to reflect current app templates. (#866)
settings.gradle:
* Add pluginManagement and dependencyResolutionManagement stanzas.

build.gradle:
* Remove declaration of repositories and dependencies, since this goes
in settings.gradle
* Use Kotlin version 1.7.10
* Use AGP version 7.3.0

app/build.gradle:
* Use `plugins { id 'foo' }` instead `apply plugin: 'foo'`
* Compile all samples with the latest version of the SDK (33) and NDK
(25.1.8937393).
* Remove kotlin-android-extensions

Furthermore:
* In CI build script, make detection of debug mode work on MacOS.
* Uncomment webp in CI build script.
* Add missing projects to CI build script (display-p3, hello-oboe,
native-midi, prefab/prefab-dependency)
* Update gradle version to 7.4
* Update hello-oboe and prefab-dependency to use view binding.
* Update native-midi to eliminate compiler warning.
2022-11-28 14:50:41 -06:00
James Farrell
434180b04a Update gradle and AGP. (#860)
Gradle 7.2
AGP 7.1.2

Also increase JVM memory for a couple of projects, and log more info when doing a debug CI build.
2022-11-16 14:26:52 -06:00
冯裴添
82d1af2cc4 Workaround permission issue when loading NNAPI model from asset file. (#804) (#827)
Co-authored-by: Kottsone <xusongw@google.com>
Co-authored-by: github-actions <github-actions@github.com>
2022-02-22 11:48:04 -08:00
Gerry
fa2ac546af Retire jcenter() in samples (#803) 2021-06-28 21:13:09 -07:00
gfan
93837e9cc5 Update to AGP(Android gradle plugin)4.2.0 2021-05-04 22:07:29 -07:00
Gerry
6c68a701ff Back merge Android 11 samples (nn-api/sequence & image-decoder) to main (#761) 2020-11-12 16:47:55 -08:00
Gerry
9282f3405f Update hello-jni and nn-sample to kotin in root directory (#741) 2020-07-06 13:16:47 -07:00
Nishant Srivastava
17ec60701d Add ndkVersion (#730)
* setup ndkVersion in build script for each project

* switch to latest stable ndk version: 21.2.6472646

Link: https://developer.android.com/ndk/downloads#stable-downloads
2020-06-03 14:02:01 -07:00
Nishant Srivastava
fee6bf078f updated gradle wrapper to 6.1.1
- min required for AGP 4.0.0
2020-06-03 10:58:32 +02:00
Nishant Srivastava
b7d603e61a update AGP to v4.0.0 (stable) 2020-06-03 10:57:32 +02:00
gfan
f7baf167c4 Remove Android 11 beta samples to fix github issue #722 2020-05-19 18:33:22 -07:00
Kottsone
b53406227c Fix nn-samples with infinite timeout duration. 2020-04-23 12:42:01 -07:00
gfan
bdab663dd0 Update R feature samples(nn-sample, image-decoder) with DeveloperPreview 3 2020-04-23 10:42:21 -07:00
Brian Ledger
4df28a3b78 Update initializater orderings to avoid -Wreorder warnings. 2020-04-21 17:36:10 -04:00
Xusong Wang
5d4dd8bcf0 Update nn-samples with dependency APIs. 2020-03-18 09:58:15 -07:00
gfan
2380f2b7e1 Update nn-samples and image-decoder to use ndk-r21.1
Test: Pixel 3 + Android R DP1.1
2020-03-04 14:59:59 -08:00
Xusong Wang
2891c27af0 Add a new NNAPI sample for R features.
Add a new sample app demonstrating the usage of the NNAPI R features.

Additionally rename the directory and fix some typos.
2020-02-19 09:30:20 -08:00