Why
The example currently hides the benchmark screen on Android because the native benchmark runner and manual recorder exist only on the iOS bridge. That makes Android performance work harder to measure and blocks true iOS/Android parity for the example harness.
Current state
On feat/android-parity:
- Android drawing is usable enough for manual testing.
- Android eraser responsiveness has improved.
- The example hides benchmark controls on Android so users do not hit unavailable native methods.
- iOS still has
runBenchmark, startBenchmarkRecording, and stopBenchmarkRecording through MobileInkCanvasViewManager / MobileInkBridge.
Goal
Implement Android equivalents for the iOS native benchmark APIs exposed by NativeInkCanvasRef:
runBenchmark(options)
startBenchmarkRecording(options)
stopBenchmarkRecording()
The output shape should match NativeInkBenchmarkResult so BenchmarkScreen.tsx, ContinuousEnginePool, and InfiniteInkCanvas can run the same code on both platforms.
Useful files
src/NativeInkCanvas.tsx
src/benchmark/types.ts
src/benchmark/aggregate.ts
example/BenchmarkScreen.tsx
ios/MobileInkModule/MobileInkCanvasView+Benchmark.swift
android/src/main/java/com/mathnotes/mobileink/MobileInkCanvasView.kt
android/src/main/java/com/mathnotes/mobileink/MobileInkModule.kt
android/src/main/cpp/jni_bridge.cpp
Suggested approach
- Mirror the iOS benchmark result schema first, even if Android internals differ.
- Prefer native timing around actual Android render/input paths rather than JS-only timing.
- Keep manual recording and replayed synthetic benchmark support separate if that simplifies the first PR.
- Once Android methods exist, remove the Android gating in
example/App.tsx so the benchmark screen appears on both platforms.
Done when
- Android exposes the same benchmark methods as iOS through
NativeInkCanvasRef.
- The example benchmark screen works on Android.
npm run typecheck, Android export, and Android debug assemble pass.
- A device/emulator run can produce benchmark JSON for at least one drawing scenario.
Why
The example currently hides the benchmark screen on Android because the native benchmark runner and manual recorder exist only on the iOS bridge. That makes Android performance work harder to measure and blocks true iOS/Android parity for the example harness.
Current state
On
feat/android-parity:runBenchmark,startBenchmarkRecording, andstopBenchmarkRecordingthroughMobileInkCanvasViewManager/MobileInkBridge.Goal
Implement Android equivalents for the iOS native benchmark APIs exposed by
NativeInkCanvasRef:runBenchmark(options)startBenchmarkRecording(options)stopBenchmarkRecording()The output shape should match
NativeInkBenchmarkResultsoBenchmarkScreen.tsx,ContinuousEnginePool, andInfiniteInkCanvascan run the same code on both platforms.Useful files
src/NativeInkCanvas.tsxsrc/benchmark/types.tssrc/benchmark/aggregate.tsexample/BenchmarkScreen.tsxios/MobileInkModule/MobileInkCanvasView+Benchmark.swiftandroid/src/main/java/com/mathnotes/mobileink/MobileInkCanvasView.ktandroid/src/main/java/com/mathnotes/mobileink/MobileInkModule.ktandroid/src/main/cpp/jni_bridge.cppSuggested approach
example/App.tsxso the benchmark screen appears on both platforms.Done when
NativeInkCanvasRef.npm run typecheck, Android export, and Android debug assemble pass.