Skip to content

Commit 6e31df4

Browse files
authored
docs(android): add a note about how to get the wasm file from a wat text format (#272)
Fixes WasmEdge/WasmEdge#2931 Signed-off-by: hydai <[email protected]>
1 parent 75285c7 commit 6e31df4

File tree

1 file changed

+6
-2
lines changed
  • docs/contribute/source/os/android

1 file changed

+6
-2
lines changed

docs/contribute/source/os/android/apk.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ class MainActivity : AppCompatActivity() {
6666

6767
### The native library
6868

69-
The Android UI app calls a `NativeLib` Kotlin object to access WasmEdge functions. The `NativeLib` source code is [available here](https://github.com/WasmEdge/WasmEdge/blob/master/utils/android/app/lib/src/main/java/org/wasmedge/native_lib/NativeLib.kt). It uses JNI (Java Native Interface) to load a C shared library called `wasmedge_lib`. It then calls the `nativeWasmFibonacci` function in `wasmedge_lib` to execute the `fibonacci.wasm` WebAssembly bytecode.
69+
The Android UI app calls a `NativeLib` Kotlin object to access WasmEdge functions.
70+
The `NativeLib` source code is [available here](https://github.com/WasmEdge/WasmEdge/blob/master/utils/android/app/lib/src/main/java/org/wasmedge/native_lib/NativeLib.kt). It uses JNI (Java Native Interface) to load a C shared library called `wasmedge_lib`.
71+
It then calls the `nativeWasmFibonacci` function in `wasmedge_lib` to execute the `fibonacci.wasm` WebAssembly bytecode.
72+
73+
Please ensure you have built the `fibonacci.wasm` file from `fibonacci.wat` in the example folder using the WABT tool or any other WebAssembly compiler.
7074

7175
```java
7276
class NativeLib(ctx : Context) {
@@ -124,7 +128,7 @@ Java_org_wasmedge_native_1lib_NativeLib_nativeWasmFibonacci(
124128
125129
### The WebAssembly function
126130
127-
The `factorial.wat` is a [handwritten WebAssembly script](https://github.com/WasmEdge/WasmEdge/blob/master/examples/wasm/fibonacci.wat) to compute factorial numbers. It is compiled into WebAssembly using the [WABT tool](https://github.com/WebAssembly/wabt).
131+
The `fibonacci.wat` is a [handwritten WebAssembly script](https://github.com/WasmEdge/WasmEdge/blob/master/examples/wasm/fibonacci.wat) to compute fibonacci numbers. It can be compiled into WebAssembly using the [WABT tool](https://github.com/WebAssembly/wabt).
128132
129133
### Build dependencies
130134

0 commit comments

Comments
 (0)