Skip to content

Improvements to the documentation for android support #7347

@KaruroChori

Description

@KaruroChori

Is your feature request related to a problem? Please describe.

Right now, the documentation to compile a simple demo for android is pretty much not functional.
https://xmake.io/examples/cpp/graphics/android.html#android-application

At the very least it does not provide enough steps for replication.
To be fair, this was my first time compiling something for android, and surely that did not help.
I was able to make it work, but it took a couple hours of debugging in an unfamiliar environment.

Basically the issues I encountered:

  • No suggested linking of libandroid in the example which is pretty much needed to have the ALooper_pollAll. The application compiles and links but when running it fails, and only inspection on the device logs tells us that dynamic linking of that symbol failed.
  • ALooper_pollAll is actually no more on modern android versions now there is ALooper_pollOnce.
  • app_dummy is deprecated too, so maybe it should be better removed.
  • Missing attribute android:exported set true for the activity in the manifest.
  • No human readable error to explain I was missing signing keys.
    local apksigner_argv = {"sign", "--ks", keystore, "--ks-pass", string.format("pass:%s", keystore_pass), "--out", final_apk, "--in", aligned_apk}
    failed because of keystore being null. It would be nice to preemptively prompt some hint for the user, or maybe generate one for this specific project just for the sake of development?

Describe the solution you'd like

Suggested fixes described above.
I am surely not experienced but I can share my functioning demo with the disclaimer that I only barely know what I am doing 😄 .

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions