Skip to content

Commit

Permalink
Pull main
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmarni-Dev committed Nov 16, 2023
2 parents 200be97 + 2f91b5c commit 2d4d7f5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/target
**/Cargo.lock
**/runtime_libs/arm64-v8a/*
\.DS_Store
37 changes: 19 additions & 18 deletions examples/android/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,24 @@ license = "MIT OR Apache-2.0"

[lib]
name = "bevy_openxr_android"
crate-type = ["staticlib", "cdylib"]
crate-type = ["rlib", "cdylib"]

[target.'cfg(not(target_os="android"))'.dependencies.bevy_oxr]
path = "../../"
default-features = true


[dependencies]
bevy_oxr = { path = "../..", default-features = false }
bevy = "0.12"
openxr = { git = "https://github.com/Ralith/openxrs", features = ["mint"] }

[profile.release]
lto = "fat"
codegen-units = 1
panic = "abort"

# This metadata is used by `cargo-apk` - `xbuild` uses the `manifest.yaml` instead.
[package.metadata.android]
package = "org.bevyengine.example_openxr_android"
build_targets = ["aarch64-linux-android"]
Expand All @@ -21,27 +37,12 @@ icon = "@mipmap/ic_launcher"
label = "Bevy Openxr Android"
strip = "strip"

[package.metadata.android.sdk]
target_sdk_version = 32


[target.'cfg(not(target_os="android"))'.dependencies.bevy_oxr]
path = "../../"
default-features = true

# [package.metadata.android.application]
# icon = "@mipmap/ic_launcher"
# label = "Bevy Example"

[dependencies]
bevy_oxr = { path = "../..", default-features = false }
bevy = "0.12"
openxr = { git = "https://github.com/Ralith/openxrs", features = ["mint"] }

[profile.release]
lto = "fat"
codegen-units = 1
# panic = "abort"
[package.metadata.android.sdk]
target_sdk_version = 32

[package.metadata.android.application.activity]
theme = "@android:style/Theme.Black.NoTitleBar.Fullscreen"
Expand Down
16 changes: 11 additions & 5 deletions examples/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@ Get libopenxr_loader.so from the Oculus OpenXR Mobile SDK and add it to `example
https://developer.oculus.com/downloads/package/oculus-openxr-mobile-sdk/
`examples/android/runtime_libs/arm64-v8a/libopenxr_loader.so`

Also, install either `cargo-apk` (marked as deprecated):
```sh
cargo install cargo-apk
```
or, install `xbuild` as it supersedes `cargo-apk`. Note that the `--git` is
very important here.
```sh
cargo install --git https://github.com/rust-mobile/xbuild
```

## Run
Running on Meta Quest can be done with https://github.com/rust-mobile/cargo-apk.
```sh
cargo apk run --release
```
But cargo-apk is deprecated in favour of xbuild https://github.com/rust-mobile/xbuild.
```sh
# Install latest version of xbuild
cargo install --git https://github.com/rust-mobile/xbuild
```
```sh
# List devices and copy device string "adb:***"
x devices

Expand Down Expand Up @@ -58,4 +64,4 @@ You can use `keytool` like so:
keytool -genkey -v -keystore my-release-key.keystore -keyalg RSA -keysize 2048 -validity 10000
```
For more information on key signing and why it's so important, check out this article:
https://developer.android.com/studio/publish/app-signing
https://developer.android.com/studio/publish/app-signing
4 changes: 3 additions & 1 deletion examples/android/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ android:
label: "Bevy Openxr Android"
theme: "@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen"
meta_data:
- name: "com.oculus.intent.category.VR"
value: "vr_only"
- name: "com.samsung.android.vr.application.mode"
value: "vr_only"
- name: "com.oculus.supportedDevices"
value: "quest|quest2|quest3"
value: "quest|quest2|quest3|questpro"
activities:
- config_changes: "density|keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|uiMode"
launch_mode: "singleTask"
Expand Down

0 comments on commit 2d4d7f5

Please sign in to comment.