Files
filament/android/samples/sample-material-builder/README.md
Romain Guy f5d5afba74 Re-organize Android Gradle files (#2013)
* Re-organize Android Gradle files

Clean up our Gradle files, share versioning, etc. and prepare for
publication to sonatype.

* Use androix annotations for desktop

* Add samples as subprojects to root Gradle

* Fix build script

* Don't break when samples aren't compiled

* Better organize the Android Studio project
2020-01-07 18:37:45 -08:00

24 lines
994 B
Markdown

# Android `material-builder` Sample
The `material-builder` sample shows how to generate materials programatically on the device as
opposed to with the `matc` tool on the host machine. The cost is a binary size increase of your app
due to the relatively larger size of the `filamat` library.
The `buildMaterial` method inside `MainActivity.kt` uses a `MaterialBuilder()` instance to compile a
material package whose payload is sent to the engine where it is applied towards the `Renderable`.
## Before building
The `filamat` static library is needed to fascilitate material building on the device. Compiling the
library is slower and thus it is not built by the default `build.sh` command. To build, add the `-l`
flag to the `build.sh` command:
```
./build.sh -i -p android release
```
Explanation of flags:
- The `-i` flag installs the libraries to `out/android-release/`, so this sample can find them.
- The `-p` flag and `android` argument choose Android as the platform to build for.