rust-mobile / xbuild

Cross compile rust to any platform
468 stars 38 forks source link

Document common manifest.yml tasks #125

Open torrancew opened 1 year ago

torrancew commented 1 year ago

Thank you for your work on this project, it greatly simplified the process of building a simple Android app I had been thinking about for some time!

One thing I stumbled over a bit was the format of manifest.yml -- I think I've got a better handle on the basic parts of it now (updating the package & label, etc), but am still struggling to set an icon.

If you could point me in the correct direction, I'd be happy to put together a simple "Hello, World" example in this repo and accompanying documentation to help future users more easily customize the Android side of things

Thanks again!

duckinator commented 8 months ago

When this is documented, whoever documents it should be sure to mention that the filename is specifically manifest.yaml.

I've seen multiple references in the issues to manifest.yml, but only manifest.yaml is actually checked!

ModernType commented 8 months ago

Can you explain how to use manifest.yaml because I struggle with it a lot and can't find any example to show how to use it, only official AndroidManifest.xml docs

ModernType commented 8 months ago

So after looking into source code for a while I finally found a way to add icon for your android app. The simplest way is to add icon attribute to your manifest.yaml like so:

icon: "icon.png"

android:
  manifest:
    application:
      label: "Library"

Your icon image should be at least 512x512 if I've got it correctly to compile

Gibbz commented 2 months ago

How do we get the manifest loading? Do we need to specify in the cargo.toml? An example file would be very handy!

beac0n commented 2 days ago

Thanks to @ModernType , I was able to create a manifest.yaml that actually set permissions in the AndroidManifest.xml

I'll leave this here for others to find, because it was very difficult to find any sort of docs for this:

android:
  manifest:
    uses_permission:
      - name: android.permission.INTERNET
      - name: android.permission.ACCESS_NETWORK_STATE
ModernType commented 2 days ago

@Gibbz You just create manifest.yaml in the root of your project, no need to touch cargo. Maybe at some point I will make an example file with full comments to every possible property, but as for now I don't have time and will to do this.

For people interested in creating docs, all the code for configs is located here. Abscense of such docs is a big problem, in my opinion, because it disables developer's ability to easily create full featured apps because you need to decypher config code beforehand