Update all of the examples#4
Merged
Merged
Conversation
Newer versions of Android will stop delivering input to applications that don't appear to be responsive because they aren't rendering anything. This updates na-mainloop and agdk-mainloop so that they at least do a NOOP post of an untouched framebuffer each frame, so that they continue to be delivered touch input.
9b7a749 to
9ea89fc
Compare
For each example, this: - Updates to using Android Gradle Plugin 8.0 - Adds ndkVersion to build.gradle - Updates all cargo deps and fixes / updates examples as needed - Avoids depending on any git branches for winit/egui now that the required Android support is upstream. - Removes all .idea files and adds .idea to .gitignore Adds a na-egui example that tests NativeActivity + Egui (same code as agdk-egui, but built against NativeActivity instead of GameActivity) This updates .github/workflows/ci.yml so all examples are built and `./gradlew build` is run - not just `cargo ndk build`
We don't currently build the OpenXR examples on Android because I haven't found a nice nice way to pull in libopenxr_loader binaries that we can link against. Normally I would use the binaries as part of the Oculus SDK TODO: maybe we can look at using the 'prefab' `.aar`s from Khronos here: https://search.maven.org/artifact/org.khronos.openxr/openxr_loader_for_android
MarijnS95
reviewed
Jun 25, 2023
| log = "0.4" | ||
| android_logger = "0.11.0" | ||
| android-activity = { version = "0.4", features = [ "native-activity" ] } | ||
| #android-activity = { path = "../../android-activity/android-activity", features = [ "native-activity" ] } |
Member
There was a problem hiding this comment.
Only noticing this now during a rebase, what is it useful for?
Member
Author
There was a problem hiding this comment.
A slight convenience for me, for testing at time but it would probably be better to have a commented out [patches] section for something like that.
It's fine if you drop it.
MarijnS95
reviewed
Jun 25, 2023
| sourceCompatibility JavaVersion.VERSION_1_8 | ||
| targetCompatibility JavaVersion.VERSION_1_8 | ||
| } | ||
| namespace 'co.realfit.namainloop' |
Member
There was a problem hiding this comment.
For cargo-apk the Cargo.toml has:
[package.metadata.android]
# Specifies the package property of the manifest.
package = "com.foo.bar"
Member
Author
There was a problem hiding this comment.
ah yep.
I should probably change the namespace entirely anyway. It's a bit random that I use my realfit.co domain to namespace these examples.
We could probably use something like rust.mobile instead of a registered domain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since I was looking at hopefully spinning an
android-activityrelease soon, I wanted to update these examples and also take the opportunity to test them againstandroid-activitymain.For each example, this:
ndkVersionto build.gradleThis also adds a
na-eguiexample that testsNativeActivity+ Egui (same code asagdk-egui, but built againstNativeActivityinstead ofGameActivity)This also fixes
*-mainloopon newer versions of Android by posting dummy frames to unblock input.Newer versions of Android will stop delivering input to applications that don't appear to be responsive because they aren't rendering anything. This updates
na-mainloopandagdk-mainloopso that they at least do a NOOP post of an untouched framebuffer each frame, so that they continue to be delivered touch input..github/workflows/ci.ymlhas been updated to ensure all the examples are built now, and./gradlew buildis run, in addition tocargo ndk build