<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: CodeDAC</title>
    <description>The latest articles on DEV Community by CodeDAC (@codedac).</description>
    <link>https://dev.to/codedac</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4183383%2Fe116642c-5324-4624-be8e-6255f1e56603.png</url>
      <title>DEV Community: CodeDAC</title>
      <link>https://dev.to/codedac</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codedac"/>
    <language>en</language>
    <item>
      <title>Android 10's clipboard restriction and serverless phone-to-PC sync: building Clipboard+</title>
      <dc:creator>CodeDAC</dc:creator>
      <pubDate>Wed, 14 Oct 2026 01:54:41 +0000</pubDate>
      <link>https://dev.to/codedac/android-10s-clipboard-restriction-and-serverless-phone-to-pc-sync-building-clipboard-2ba9</link>
      <guid>https://dev.to/codedac/android-10s-clipboard-restriction-and-serverless-phone-to-pc-sync-building-clipboard-2ba9</guid>
      <description>&lt;p&gt;I'm a solo developer making small utility apps for Android and Windows. The one with the most users is &lt;strong&gt;Clipboard+&lt;/strong&gt;, a clipboard history manager. Two problems shaped almost every design decision in it: &lt;strong&gt;Android 10's clipboard restriction&lt;/strong&gt; and &lt;strong&gt;syncing between phone and PC without running a server&lt;/strong&gt;. Here's how I handled both.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Since Android 10, background apps can't read the clipboard
&lt;/h2&gt;

&lt;p&gt;From Android 10 (API 29), only the app that currently has &lt;strong&gt;input focus&lt;/strong&gt; (or the default keyboard) can read the clipboard. The classic clipboard-manager design, a background service that saves every copy, simply stops working. There are workarounds through accessibility services or log permissions, but given Play policy and user trust I didn't want to go there.&lt;/p&gt;

&lt;p&gt;So I changed the promise instead of fighting the platform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No "auto-save" claim.&lt;/strong&gt; I removed that wording from the store listing too.&lt;/li&gt;
&lt;li&gt;Save &lt;strong&gt;every time the app legitimately gets focus&lt;/strong&gt;: when the app opens, when you &lt;strong&gt;tap the floating panel&lt;/strong&gt;, and when you use the &lt;strong&gt;home-screen widget&lt;/strong&gt;. The floating panel is an overlay window that is normally &lt;code&gt;FLAG_NOT_FOCUSABLE&lt;/code&gt;; on tap it briefly clears that flag to take focus, reads the clipboard, then gives focus back.&lt;/li&gt;
&lt;li&gt;For saving without switching apps, there's an entry in the &lt;strong&gt;text selection menu (&lt;code&gt;ACTION_PROCESS_TEXT&lt;/code&gt;)&lt;/strong&gt;. Select text anywhere, pick "Clipboard+", and it lands in the history.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You lose "everything you copy just piles up", but "the moment you open the panel to paste, the last thing you copied is saved too" covers most real use.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. No sync server
&lt;/h2&gt;

&lt;p&gt;Clipboards are full of passwords, addresses, account numbers and one-time codes. I didn't want any of that passing through my server, and as a one-person studio I didn't want to run one forever either.&lt;/p&gt;

&lt;p&gt;So the storage is &lt;strong&gt;the user's own Google Drive&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Android and Windows apps each connect to the user's Drive and sync through the hidden, app-only &lt;strong&gt;&lt;code&gt;appDataFolder&lt;/code&gt;&lt;/strong&gt;. It doesn't show up in the Drive UI, and the app can't see the user's other files. Sync uses the &lt;code&gt;drive.appdata&lt;/code&gt; scope; backup files use &lt;code&gt;drive.file&lt;/code&gt;, which only covers files the app created.&lt;/li&gt;
&lt;li&gt;On Android I skipped the old Drive Android API: &lt;strong&gt;&lt;code&gt;AuthorizationClient&lt;/code&gt; just gets an access token, and the app calls Drive REST v3 directly&lt;/strong&gt;. Fewer dependencies, and the same API shape as the Windows side.&lt;/li&gt;
&lt;li&gt;No server means no hosting cost, and I can honestly tell users "your data only lives in your own Drive".&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Don't hold data hostage when people switch phones
&lt;/h2&gt;

&lt;p&gt;Backup and restore started as paid features. Keeping someone's data locked when they change phones felt wrong, so &lt;strong&gt;backup file export/import and Drive restore are now free&lt;/strong&gt;. Pro is ad removal, live phone-PC sync, unlimited image clips and the larger panel/widget.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback welcome
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Cases where something doesn't get saved (which app, which Android version)&lt;/li&gt;
&lt;li&gt;Whether the "your own Drive, no server" setup feels trustworthy, or whether the permission screen makes it feel the opposite&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I read every comment.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google Play: &lt;a href="https://play.google.com/store/apps/details?id=com.codedac.clipboard" rel="noopener noreferrer"&gt;https://play.google.com/store/apps/details?id=com.codedac.clipboard&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Windows (Microsoft Store): &lt;a href="https://apps.microsoft.com/detail/9N9SRKQV1R6D" rel="noopener noreferrer"&gt;https://apps.microsoft.com/detail/9N9SRKQV1R6D&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;More: &lt;a href="https://codedac.com/apps/clipboard.html" rel="noopener noreferrer"&gt;https://codedac.com/apps/clipboard.html&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>android</category>
      <category>java</category>
      <category>privacy</category>
    </item>
  </channel>
</rss>
