惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
云风的 BLOG
云风的 BLOG
小众软件
小众软件
IT之家
IT之家
T
Tailwind CSS Blog
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
美团技术团队
博客园 - 叶小钗
V
V2EX
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
罗磊的独立博客
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
月光博客
月光博客
有赞技术团队
有赞技术团队

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Project Log #9: My AI Agent Works on My Phone. But What A...
Okeke Chukwudubem · 2026-06-21 · via DEV Community

Okeke Chukwudubem

Day 9. Template matching works. But screen sizes, resolutions, and Android versions might break everything.

Eight days ago, the agent was an idea. Now it can read text, handle interruptions, and find icons on a screen.

But there's a question I've been avoiding: does it work on any phone other than mine?

The Cross-Device Problem

Every screenshot I've taken, every icon I've cropped, every coordinate I've mapped—it's all on one device. My phone. Same screen size. Same resolution. Same Android version. Same DPI.

Template matching relies on reference images that look exactly like the target on screen. Change the screen density, change the icon size, change the font scaling, and the match confidence drops. Suddenly "send_button.png" doesn't match anymore, and the agent can't press send.

This isn't a bug in my code. It's a fundamental challenge in computer vision: reference-based matching breaks when the visual context changes.

Today's Experiment

I tested the same agent on a friend's phone—different manufacturer, different Android version, slightly larger screen. The results were humbling.

Task My Phone Friend's Phone
OCR (text recognition) ✅ 95% accuracy ✅ ~90% accuracy
Find "Mom" in contacts ✅ Found ✅ Found
Template match: send button ✅ 94% confidence ❌ 62% confidence
Template match: back button ✅ 91% confidence ❌ 58% confidence

OCR held up reasonably well because text is text. Fonts might change slightly, but the characters are the same. But the icons—the send button, the back arrow—were rendered at a different size and slightly different pixel arrangement on my friend's device.

The agent failed to send the message.

Why This Matters

An AI agent that only works on one phone isn't an agent. It's a script. If I want this to be useful to anyone else—or even to myself if I change phones—it needs to be device-agnostic.

Possible Solutions I'm Exploring

Solution Pros Cons
Multi-resolution icon library Simple. Just crop icons at different DPIs. Tedious. How many variants are enough?
AI-based icon detection Could recognize icons by shape, not pixels. Requires training data. Heavy for a phone.
UI hierarchy inspection Instead of "seeing" the screen, read the app's UI tree directly via ADB. Requires root or accessibility service. Not universal.
Relative positioning Once OCR finds text, calculate icon positions relative to known landmarks. Fragile. Different layouts on different devices.

None of these are perfect. All of them are more work. But that's the reality of building something that's supposed to work in the wild, not just in a demo.

What I'm Trying First

The UI hierarchy approach. ADB has a command called uiautomator dump that returns an XML tree of every visible element on screen—text, buttons, icons, everything. Each element has bounds, a class name, and a content description.

If I can parse that XML tree instead of taking screenshots, the agent doesn't need to "see" the screen at all. It just reads the structure. No OCR. No template matching. No resolution issues.

This is a fundamental architectural shift. But it might be the right one.

What's Next (Day 10)

  • Experiment with uiautomator dump as a replacement for screenshot-based detection
  • Compare speed and accuracy against current OCR + template matching pipeline
  • Decide whether to pivot the entire vision system

The Repo

👉 github.com/Dexter2344/phone-agent

All code from Day 8 is live. The Day 9 experiments are in a new branch called ui-tree-experiment. I'll merge to main once I have results.

This is Day 9. The hard problems don't stop coming. But neither do I.