Merge pull request #38 from TheButlah/improve-android-example
Improved android example
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
/target
|
||||
/Cargo.lock
|
||||
\.DS_Store
|
||||
|
||||
@@ -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"]
|
||||
@@ -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"
|
||||
|
||||
@@ -5,6 +5,16 @@ 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
|
||||
@@ -12,10 +22,6 @@ 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user