Skip to content

Android example based on GameActivity #12026

@fr-an-k

Description

@fr-an-k

What problem does this solve or what need does it fill?

  1. The mobile example (bevy 0.13) doesn't work on my devices <= Android 8.1. When I did get it to work (bevy 0.12) the button was offset from the place where you touch.

  2. GameActivity works better, is the current recommended approach and a better match for Bevy. NativeActivity is legacy, crashes on Android <= 5.1 and doesn't have a surface needed for the onscreen keyboard.

  3. Cargo apk is deprecated and too limited. GameActivity is compiled separately using a normal Android project, which is what any serious game developer would need anyway. You can keep the Android project in a separate folder from the rust project; the rust part is compiled using cargo ndk.

  4. wgpu currently does not work on Android without Vulkan if the backend is not set to GL.

  5. The contents of the example could be improved; the zooming is weird and does not use the touch drag in a sensible way.

What solution would you like?

I'm just reporting and not saying this is a priority, but bevy is going to need a GameActivity example since that is the appropriate way to go for a game engine.
It could be based on the agdk examples from rust-android-examples, it's not difficult.
Ideally it would demonstrate use of the keyboard as well (as abstracted by winit, but you need to pass around AndroidApp in order to show the keyboard).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Build-SystemRelated to build systems or continuous integrationC-ExamplesAn addition or correction to our examplesO-AndroidSpecific to the Android mobile operating system

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions