Skip to content

Commit b1c4f5c

Browse files
committed
Update README
1 parent 6846346 commit b1c4f5c

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@ This will be a library that can be reused to implement an Android view in Rust.
77
* Event handlers and other view callbacks run directly on the UI thread; there is no sending events to a separate Rust event loop thread.
88
* This crate intends to stick as close as possible to the Android framework. This will be especially important for text input support.
99

10-
So far, glue code has been written for implementing several Android framework methods (on both `View` and `SurfaceHolder.Callback`) in Rust, but the plumbing for `InputConnection` still needs to be done. The reusable Java code also isn't yet cleanly separated from the demo application.
10+
## Building and running the demos
1111

12-
## Building and running the demo
12+
### Common setup
1313

1414
```bash
1515
export ANDROID_NDK_HOME="path/to/ndk"
1616
export ANDROID_HOME="path/to/sdk"
1717

1818
rustup target add aarch64-linux-android
1919
cargo install cargo-ndk
20+
```
21+
22+
### Simple editor demo
2023

24+
```bash
2125
cargo ndk -t arm64-v8a -o app/src/main/jniLibs/ build -p android-view-demo
2226
./gradlew build
2327
./gradlew installDebug
@@ -26,6 +30,17 @@ adb shell am start -n org.linebender.android.viewdemo/.DemoActivity
2630
adb shell run-as org.linebender.android.viewdemo logcat -v color
2731
```
2832

33+
### Masonry demo
34+
35+
```bash
36+
cargo ndk -t arm64-v8a -o masonry-app/src/main/jniLibs/ build -p android-view-masonry-demo
37+
./gradlew build
38+
./gradlew installDebug
39+
adb shell am start -n org.linebender.android.masonrydemo/.DemoActivity
40+
# To view logs:
41+
adb shell run-as org.linebender.android.masonrydemo logcat -v color
42+
```
43+
2944
## Open questions
3045

3146
* Do we need to be able to handle the view being reattached to a window after it has been detached? If not, then `onDetachedFromWindow` is the logical place to sever the connection between Java and native.

0 commit comments

Comments
 (0)