Commit Graph

7 Commits

Author SHA1 Message Date
Robert Bragg 57b5192366 Update examples
This updates both the examples to Gradle 9 and AGP 9.1

The examples are identical, except that `na-mainloop` is based on
NativeActivity and the `agdk-mainloop` based on GameActivity.

The examples demonstrate:
- Using the `jni` API to define enough bindings to be able to send a Toast
- Using an `android_on_create` entry point for logging initialization
  and JNI initialization
- Using `AndroidApp::run_on_java_main_thread()` to send a toast from the
  Java main / UI thread
- Running an `android_main` event loop, including printing historic
  pointer samples (a new 0.6.1 feature)

The examples support two input actions:
- Lifting your finger in the top-left corner of the screen will show the
  onscreen keyboard
- Lifting your finger in the top-right corner of the screen will hide
  the onscreen keyboard

If you edit and disable `configChanges` in `AndroidManifest.xml` then
these examples can also demonstrate that `android-activity` gracefully
handles repeated `Activity` create -> run -> destroy cycles.
2026-03-23 22:37:54 +00:00
Robert Bragg 47b2e279e0 Remove Cargo.lock files for examples
When splitting out the rust-android-examples we kept the agdk-mainloop
and na-mainloop examples in part so we would have some simple code we
can build as integration tests.

Since it's less likely that these will be referenced directly as
examples now, compared to those in rust-android-examples this removes
the lock files so we will instead always build against the latest semver
compatible dependencies.

Considering the simplicity of these examples, and minimal dependencies
these lock files probably weren't that worthwhile before either.
2022-12-23 01:00:57 +00:00
Robert Bragg 2e279210a3 Remove most examples
Most of the examples weren't strictly just demonstrating how to use the
android-activity API - rather they demonstrated using other libraries
in conjunction with android-activity.

Most of the examples have now been split into a standalone repository
under: https://github.com/rust-mobile/rust-android-examples

The na-mainloop and agdk-mainloop examples have been kept here since
they can be built against the local/in-tree version of android-activity
and are useful to keep for CI purposes.

This also runs `cargo update` for the na-mainloop and agdk-mainloop.
2022-12-20 19:55:10 +00:00
Robert Bragg 649b65c0c0 Update examples
- Updates deps
- Some README updates considering the Winit backend based on
  android-activity has been merged upstream
- runs cargo fmt over examples
- Top-level Cargo.toml simply excludes "examples" instead of
  listing each sub-directory separately
2022-11-10 19:28:01 +00:00
Robert Bragg e8ae198653 Update example deps + update for latest winit branch
The winit based examples no longer have an explicit dependency on
android-activity and they instead consume the `android-activity` API via
the Winit crate so there's no need to keep the versions synchronized.
2022-10-22 21:51:27 +01:00
Robert Bragg 47afecda36 Release 0.4.0-beta 2022-09-20 02:56:05 +01:00
Robert Bragg 17f0c674c0 Don't ignore Cargo.lock files for examples 2022-09-20 00:41:21 +01:00