I'm a solo developer. Over the last year I've published a few dozen small Android utilities under the name DangNH Studio, and one of them is a clipboard manager called ClipFox. I assumed it would be the easy one. A clipboard is one system service, how hard can it be?
It turned out to be the app where Android's privacy changes affected my design the most. Here is what I learned, in the order it surprised me.
1. The background listener stopped working
The classic clipboard manager idea is this: register a listener, record every copy, show the history later.
val cm = getSystemService(ClipboardManager::class.java) cm.addPrimaryClipChangedListener { val text = cm.primaryClip?.getItemAt(0)?.coerceToText(this) saveToHistory(text) } On Android 9 and below this worked from a background service. From Android 10, ClipboardManager only gives clip contents to two callers: the app that currently has input focus, and the default input method (your keyboard). A service in the background gets nothing, and the listener doesn't give you the text. That is the right call for users, because for years any app could quietly read the password you had just copied. But it kills "record everything silently".
If you read tutorials from 2016, they will tell you to run a foreground service and listen. They are describing a platform that no longer exists.
2. So when can you read the clipboard?
When your app has focus. In practice, that means three moments:
- the user opens the app,
- the user taps something that brings your window into focus (for example a floating bubble),
- the user is in your keyboard (only if you are the IME, which is a different, much bigger project).
For ClipFox I made that the whole model: the app reads the clipboard when you open it or its floating bubble, and saves what is there. I stopped fighting the rule. It also made the product honest. I can tell users exactly when the app reads the clipboard, and the Play listing and the privacy page say the same.
A pattern that works in Activities and views is to read in the focus callback, not in onCreate, because the focus can arrive a moment after the window appears:
override fun onWindowFocusChanged(hasFocus: Boolean) { super.onWindowFocusChanged(hasFocus) if (hasFocus) readClipboardOnce() } If you read too early on a newer Android version, primaryClip can come back null even though the user just copied something. The fix is waiting for focus.
3. Android 12 shows a message when you read
From Android 12, the system shows a short on-screen message ("[App] pasted from your clipboard") when an app reads clip data that another app copied. You can't suppress it, and you shouldn't want to.
My design response: read once per open, not in a loop, and never read "just in case". If your clipboard app triggers that message every few seconds, users will think it's malware, and they would be right.
4. Sensitive content: Android 13 gave us a flag
Password managers can mark what they copy as sensitive, and Android 13 (API 33) exposes it so apps can avoid saving or showing it:
val extras = clip.description.extras val sensitive = if (Build.VERSION.SDK_INT >= 33) { extras?.getBoolean(ClipDescription.EXTRA_IS_SENSITIVE) == true } else false if (!sensitive) saveToHistory(text) ClipFox has a setting, on by default, to ignore sensitive text. Not every app sets that flag, so it will miss some things. That's why I never claim "we never store anything private": it's a claim I can't prove.
The lesson I took from this part: when you build anything that touches user data, assume the platform flag is missing on half the devices and design the safe default yourself.
5. Snippets are the real feature
Once history became "what you copied recently, when you open the app", I noticed that people used it less than I expected. What they came back for was the other list: saved snippets. Replies to customers, an address, bank details, a hashtag set. Copy once, tap to paste forever.
That changed my roadmap. Instead of making history cleverer, I made the snippet list faster to reach: the bubble opens it directly, and one tap puts the text where the cursor is. The code for that part is boring local storage and a list, which is exactly the right amount of excitement for a utility.
6. How I handle ads without making the tool annoying
I'll be direct, since people ask: the apps are free and contain ads (AdMob), with an optional one-time purchase that removes them. For a utility, the rule I set is that ads never sit on the action itself.
It is a trade-off, not a virtue. Utilities earn little per user, and a small developer needs some income for the apps to be maintained. If you disagree with the model, I understand.
7. What I'd tell someone building something similar
- Don't promise background capture on modern Android. If an app says it does it without root, ADB or accessibility tricks, ask how.
- Read on focus, read once. It keeps you inside the rules and keeps users calm.
- Treat sensitive data as a default, not an option. Ship the safe setting turned on.
- Say exactly when your app touches the clipboard. Users forgive limits. They don't forgive surprises.
- Look at what people actually use. My clipboard app became a snippet app. Yours might shift too.
- Prefer notification-style or visible UI over accessibility services. They add permissions Google Play and users both look at hard.
Disclosure
I wrote this because I built ClipFox, which is free on Google Play (ClipFox page). The platform behaviour above comes from the Android documentation for each release. Behaviour can vary by manufacturer, so test on real devices. If you think I've got a detail wrong, tell me in the comments and I'll correct the post.
What's the smallest Android utility you've shipped where the platform rules changed your design? I'd like to hear it.