Skip to content

Latest commit

Β 

History

History
59 lines (46 loc) Β· 1.89 KB

DEVELOPMENT.md

File metadata and controls

59 lines (46 loc) Β· 1.89 KB

← Back to README

πŸ”¨ Development Guide

πŸ—οΈ Building from source

cd android
./gradlew assembleDebug       # Build debug APK
./gradlew test                # Run unit tests
./gradlew connectedAndroidTest  # Run instrumented tests (requires device)

πŸ“¦ Project Structure

neuralbridge/
β”œβ”€β”€ android/                       # Android app (runs on device)
β”‚   β”œβ”€β”€ app/src/main/
β”‚   β”‚   β”œβ”€β”€ kotlin/.../companion/
β”‚   β”‚   β”‚   β”œβ”€β”€ mcp/              # Embedded MCP HTTP server (Ktor CIO, port 7474)
β”‚   β”‚   β”‚   β”œβ”€β”€ service/          # AccessibilityService + command handler
β”‚   β”‚   β”‚   β”œβ”€β”€ gesture/          # Gesture engine
β”‚   β”‚   β”‚   β”œβ”€β”€ input/            # Text input, clipboard, key events
β”‚   β”‚   β”‚   β”œβ”€β”€ screenshot/       # MediaProjection + libjpeg-turbo (JNI)
β”‚   β”‚   β”‚   β”œβ”€β”€ network/          # TCP server + protobuf codec
β”‚   β”‚   β”‚   β”œβ”€β”€ uitree/           # UI tree walker + semantic extraction
β”‚   β”‚   β”‚   └── notification/     # NotificationListenerService
β”‚   β”‚   β”œβ”€β”€ cpp/                   # JNI (libjpeg-turbo JPEG encoding)
β”‚   β”‚   └── res/                   # Resources
β”‚   β”œβ”€β”€ proto/                     # Protobuf schema (source of truth)
β”‚   └── build.gradle.kts
β”œβ”€β”€ examples/                      # Example MCP client
β”‚   └── mcp_client.py
β”œβ”€β”€ docs/                          # Documentation
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ SECURITY.md
└── LICENSE                        # Apache 2.0

πŸ”„ Updating the protobuf schema

The schema at android/proto/neuralbridge.proto is the source of truth. When you change it, regenerate Kotlin code:

cd android && ./gradlew generateProto

πŸ“‹ Viewing companion app logs

adb logcat -s NeuralBridge:V