Android 10's clipboard restriction and serverless phone-to-PC sync: building Clipboard+
I'm a solo developer making small utility apps for Android and Windows. The one with the most users is Clipboard+ , a clipboard history manager. Two problems shaped almost every design decision in it: Android 10's clipboard restriction and syncing between phone and PC without running a server . Here's how I handled both. 1. Since Android 10, background apps can't read the clipboard From Android…
Clipboard+ is a popular Android and Windows utility app created by a solo developer, primarily known for its clipboard history management features. Two key design challenges influenced the app's development: Android 10's restriction on background apps reading the clipboard, and the need for phone-to-PC synchronization without relying on a server. Here's how the developer addressed these issues.
With the introduction of Android 10 (API 29), background apps lost the ability to read the clipboard. The traditional clipboard manager, a background service that stores every copied item, became inoperable under this new limitation. To overcome this challenge, the developer opted for a more user-centric approach. Instead of offering automatic clipboard saving, they focused on manual control.
The app now saves clipboard content at three specific moments: when the app opens, when the user taps its floating panel, and when the home-screen widget is used. Additionally, there's an option to save selected text through the text selection menu (ACTION_PROCESS_TEXT). By selecting text anywhere and choosing Clipboard+, the copied text is immediately added to the history.
The moment the user opens the panel to paste, the most recently copied item is saved automatically, catering to the majority of real-world usage scenarios.
The second major challenge was the synchronization of clipboard data between Android and Windows devices without the need for a server. Given the sensitive nature of the data stored in clipboards (such as passwords, addresses, and one-time codes), the developer decided against using their own server for storage and synchronization.
Instead, they leveraged Google Drive as the storage solution. Both the Android and Windows versions of Clipboard+ establish a connection to the user's Google Drive and synchronize data through the hidden app-only appDataFolder. This approach ensures that the data remains private and does not leave the user's Google Drive. For backup purposes, the app uses the drive.appdata scope, while actual files created by the app fall under drive.file.
By using the Drive REST v3 API on both platforms, the developer minimized dependencies and ensured a consistent API experience between the Android and Windows apps. Importantly, this serverless approach means no hosting costs and allows the developer to assure users that their data resides solely within their own Google Drive.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.