Offline bidirectional clipboard and screenshot sync between Android and Windows over Bluetooth RFCOMM.
btclip pairs a Windows Rust host and an Android Kotlin client using raw Bluetooth SPP without internet or cloud services.
- Private Bluetooth Sync: Clipboard and image data move directly over RFCOMM.
- Bidirectional Text: Copy from Android to PC or from PC to Android.
- Screenshot Image Transfer: Send screenshots from phone to PC as image clipboard payloads.
- Lightweight: Rust host plus Kotlin client keep the app footprint small.
- Frame Protocol: Uses a fixed 5-byte frame header for robust stream parsing.
| Component | Location | Role |
|---|---|---|
| PC Host | Repository root | Rust RFCOMM server, Windows clipboard bridge, binary frame parser/encoder. |
| Android App | client/ |
Kotlin foreground client, Bluetooth SPP, clipboard bridge, FileProvider image sharing. |
| Transport | Bluetooth RFCOMM | Standard SPP UUID 00001101-0000-0000-0000-00805F9B34FB for raw socket transport. |
Frames are encoded as:
[1-byte Type][4-byte Big-Endian Length][Payload]
0x01= UTF-8 text0x02= PNG/JPEG image bytes- Length = Big-endian unsigned 32-bit payload size
- Payload = exact text or image bytes
btclip/
├── Cargo.toml
├── src/
│ ├── main.rs
│ ├── bluetooth.rs
│ ├── clipboard.rs
│ └── protocol.rs
└── client/
├── build.gradle.kts
├── gradle.properties
├── settings.gradle.kts
├── gradle/
│ └── wrapper/
├── gradlew
├── gradlew.bat
└── app/
├── build.gradle.kts
└── src/main/
├── AndroidManifest.xml
├── java/com/forgata/btclip/
│ ├── MainActivity.kt
│ └── ProtocolParser.kt
└── res/xml/file_paths.xml
The Android code is isolated under client/. The client includes:
MainActivity.ktfor runtime permission requestsProtocolParser.ktfor RFCOMM frame parsing over anInputStreamAndroidManifest.xmlwith Bluetooth and foreground service permissionsfile_paths.xmlto share cache files throughFileProvider
From the repository root:
cargo build --releaseRun the host binary:
.\target\release\btclip.exeFrom the client/ directory:
cd client
.\gradlew.bat assembleDebug --no-daemonOr on Unix-like shells:
cd client
./gradlew assembleDebug --no-daemonUsing the Gradle wrapper:
cd client
.\gradlew.bat installDebugOr directly with ADB after building:
adb install -r app\build\outputs\apk\debug\app-debug.apk- Pair your Android phone and Windows PC in system Bluetooth settings.
- Start the PC host binary.
- Install and run the Android client.
- Grant Bluetooth and notification permissions when prompted.
- Use clipboard copy on either side to sync text or images.
- Keep Android source strictly inside
client/. - The host lives in the repository root as a Rust crate.
client/already includes Gradle wrapper files for CLI builds.