Convert web app into an apk


#1

First let me say that cargo apk works surprisingly well. kudos!

Now to the point. I have a small web app in Rust that I would like to try in an android device. I have the following questions:

  1. What would be the right way to start the webserver and open the browser?

  2. How I use the assets? The example on https://github.com/tomaka/android-rs-glue/tree/master/examples/use_assets does not seem to work


#2
  1. That example is outdated. You need to add
[package.metadata.android]
assets = "<path-to-assets>"

to your Cargo.toml, like here: https://github.com/ozkriff/zoc/blob/dbd4ea5/Cargo.toml#L12-L13


#3

hey @hgrecco - did @ozkriff solution worked for you?


#4

I just realized that the version of cargo-apk and android_glue on crates.io were very old. I published new versions.


#5

@ozkriff and @tomaka. It works now. Thanks a lot. Any idea about the other question? My application starts a local web server and I want to open a browser pointing to it, and close the application when the browser is closed.