Are there some good tutorials on using wasm, rust and android?

As far as I understand one needs to start a webview on android and start the wasm code that was compiled from rust.

There is this entry https://dev.to/h_ajsf/building-wasm-android-and-ios-app-with-singlecommon-rust-core-code-3ja4

But this one doesn't explain why it's doing what it does.

Looks like it starts a minimal browser and then makes it run the wasm. Basically like a website but stored locally.

I was able to understand it that far as well. I wish for a more detailed tutorial.
I guess wasm is still to young as to allow for good step by step guides to exist yet.

There is https://rustwasm.github.io/.

I don't know much about android… but I stopped targeting it directly as it was quite terrible.

Wrapping wasm in a webview is not something I would recommend, as you get the worst of all:

  • slower than native
  • far more restrictive api than native
  • still locked to a platform
  • probably outdated browser providing the webview

I don't really understand why you believe some of those con arguments apply.

-far more restrictive api: do you mean I can't use networking, graphics libraries even though I am drawing to the same context as the browser does? Can't I do all the things that browser can?

-locked to a plattform: only if I use something like the accellerometer which probably has no methods. GPS however should work. The whole point of wasm is to make it platform independent. The Idea after all is to have an app that will be the same on all

This all falls apart if the android "webview" does not support wasm. Which is a good point to make about outdated browsers.

What I am looking for is a way to develop an android app without java just using rust.

I am not an Android developer, but the last time I checked, this was not possible.

This looks like a viable approach:

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.