Using subxt with bevy engine

  1. You need to install crossbundle if you haven't already. See documention to install it and configure your project.

  2. Specify subxt crate and bevy in your Cargo.toml. We prefer to use versions below:

[dependencies]
subxt = "0.23"
bevy = "0.8.1"

You might need additional dependencies to write your code. See examples/bevy-explorer/cargo.toml

Bevy explorer example

To learn how to use subxt with bevy engine, you can go to the examples/bevy-explorer or install bevy explorer template. Follow next steps:

  1. Install cargo-generate:
cargo install cargo-generate
  1. Install bevy-explorer template:
crossbundle new example --template=bevy-explorer
  1. After previous steps, now you can install the application on the device.

Installing application on the device

You can deploy the application on your device or android emulator with commands below. At first, you should go to example directory. Use it:

Bash:

If the template was installed

cd example

If bevy-explorer example will be used

cd example/bevy-explorer

By default crossbundle build android command will generate gradle project and install apk on your device. To build native .apk and .aab see commands below. To build native APK and run it on the device using the command. If you want to build an application replaces run with build.

crossbundle run android -s=native-apk

or

crossbundle run ios

To build native AAB and run it on the device using the command. If you want to build an application replaces run with build.

crossbundle run android -s=native-aab