README files for Android SDK and mentat_ffi

This commit is contained in:
Grisha Kruglov 2018-06-01 15:37:35 -04:00
parent b6d69f9157
commit cf6f6f9ef7
2 changed files with 30 additions and 0 deletions

22
ffi/README.md Normal file
View file

@ -0,0 +1,22 @@
# Development flow for Mentat FFI
## Android SDK
Android Mentat SDK is one of two first-party consumers (the other one being iOS Mentat SDK).
Binaries produced by `cargo build ...` are symlinked from within the SDK, and a number of target-specific `libmentat_ffi.so` binaries are bundled together and distributed with the SDK.
There is a build script at `<mentat_root>/scripts/android_build.sh` which knows how to cross-compile `mentat_ffi` for various Android targets.
- `./<mentat_root>/scripts/android_build.sh` - compiles for all supported targets
- `./<mentat_root>/scripts/android_build.sh x86` - compiles for `x86`
- `./<mentat_root>/scripts/android_build.sh x86 arm` - compiles for `x86`, `arm`
General development flow while working on the Android SDK is:
- (pre) compile for all targets, if you've never done so
- make changes to `mentat_ffi` and/or `mentat`
- re-compile `mentat_ffi` binaries using `./android_build.sh x86`. During development it's faster to compile just for the target which matches your emulator, e.g. `x86`
- make corresponding changes in the Android SDK, try them out from within the bundled sample project
- since binaries are symlinked, no manual copy step is necessary for the Android SDK to pick up the changes
## iOS SDK
TODO, contribute via [issue #732](https://github.com/mozilla/mentat/issues/732).

8
sdks/android/README.md Normal file
View file

@ -0,0 +1,8 @@
# Android Mentat SDK
Exposes Mentat functionality to Android applications via the foreign function interface provided by `mentat_ffi`.
Note that `libmentat_ffi.so` binaries are symlinked. Use [the cross-compilation script](https://github.com/mozilla/mentat/tree/master/scripts/android_build.sh) to build them. Windows users: apologies if you're on FAT; symlinks are supported on NTFS (on Vista and later).
- See [sample projects](https://github.com/mozilla/mentat/tree/master/sdks/android/Mentat/samples) for how one might use the SDK.
- See [documentation](https://github.com/mozilla/mentat/tree/master/ffi/README.md) within the `mentat_ffi` crate for development flow.