This repository implements a generic library for Android. This is not the app itself.
Unfortunately there's no way to keep track of the clipboard unless you are the keyboard app (custom IME). Implementing a keyboard app just to track clipboard changes is a huge task, so instead we provide a pluggable library that can be integrated into other open-source apps.
List of patched apps:
The library is hosted on JitPack, the link contains installation instructions.
This library wraps the same generic-client
using FFI and wraps it later with Kotlin API.
Build scripts automatically download the static library and the header from generic-client
repo (android-arm64 build) and compiles them into dynamic library that is later loaded by Android runtime.
Additionally the library provides:
- settings screen written in Jetpack Compose that can be rendered in the target IME app
- connectivity widget for your Home Screen
In short, the API is not only designed to be minimal but also to have as few interactions with existing code as possible:
- add JitPack to the list of repositories somewhere in
settings.gradle.kts
- add
implementation 'com.github.mpclipboard:mpclipboard-android:Tag'
to dependencies list - make sure the app has permission for
INTERNET
- change existing IME service to create an Android's
ClipboardManager
and subscribe to it - instantiate
MPClipboard
class provided by this library - subscribe to its changes and do bi-directional copying between local clipboard and MPClipboard
- register a widget
Patched version of https://github.com/mpclipboard/android-florisboard is a "good enough" reference implementation. Clone it, apply a patch and check the diff, there are only 105 LOC and all of them are additions, so you don't need to understand how FlorisBoard works.