-
Notifications
You must be signed in to change notification settings - Fork 26
Update all of the examples #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
| 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" ] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only noticing this now during a rebase, what is it useful for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| sourceCompatibility JavaVersion.VERSION_1_8 | ||
| targetCompatibility JavaVersion.VERSION_1_8 | ||
| } | ||
| namespace 'co.realfit.namainloop' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For cargo-apk the Cargo.toml has:
[package.metadata.android]
# Specifies the package property of the manifest.
package = "com.foo.bar"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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