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

推荐订阅源

Recent Announcements
Recent Announcements
博客园 - Franky
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
爱范儿
爱范儿
罗磊的独立博客
博客园_首页
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
V
Visual Studio Blog
T
Tailwind CSS Blog

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
My homescreen was chaos. Not anymore.
niluved · 2026-06-21 · via DEV Community
Cover image for My homescreen was chaos. Not anymore.

niluved

I built an Android widget that learns your app habits — without sending anything to a server

I had a problem. My home screen was organized chaos: folders for Work, Music, Streaming, Chat, Hobbies. Every evening I’d open the same three folders in the same order just to launch the same handful of apps. I wasn't finding apps — I was repeating a ritual.

My phone already knows what I do and when I do it — it just never puts that knowledge to use. So I built Habits to teach it to repeat what it has already seen.


The constraint: Android only remembers a few days

The predictive feature needs the Usage Access permission. The problem? Android only retains raw usage history for a few days by default. After that, the data is gone.

I needed enough history to recognize actual patterns — not just what I opened yesterday, but what I open at 8 AM on a typical Tuesday. That requires weeks of accumulated history, and Android doesn’t give you that out of the box.

I also wasn't willing to ship app usage logs to a backend. This widget was going to be smart, but only if it could be smart without touching a server.


How it works under the hood

Habits accumulates usage history on the device — timestamps, durations, which apps — storing it for long enough to smooth out noise and detect recurring patterns. A statistical model then correlates the current time slot with past behavior to assign relevance scores to installed apps.

The model balances two signals:

  • Long-term habits (default weight: 75%): apps you tend to use at this time of day over the past weeks
  • Short-term context (default weight: 25%): apps you opened in the last few minutes, which suggest what you’re about to do next

You can adjust the relative weight of each factor in settings, so the widget adapts to how predictable your routine actually is.


What the widget actually does

  • Surfaces apps contextually: morning coffee → news apps, Friday evening → streaming and music
  • Customizable grid (columns/rows) directly in widget settings
  • Monochromatic icon support natively — no third-party icon packs needed
  • Material You dynamic colors, custom backgrounds, adjustable icon sizes
  • Pin/exclude apps: keep essentials always visible, hide outliers
  • Full icon pack support if that's your setup
  • Export/import your history: the usage database can be exported and re-imported on a new device — your model follows you, no lock-in

The honest version (the stuff I'd want to know before installing)

  • Usage Access is required — the core feature doesn't work without it. The app prompts for it on first launch.
  • No accounts, no IAP, no ads — but also no cloud sync, no server fallback.
  • No magic: the predictions are based on patterns in your own history. If your habits are genuinely unpredictable (shift worker? seasonal routine?), the widget won't help much.

Stack

  • Kotlin, native Android
  • Jetpack Compose + Glance widget
  • Apache Commons Math for the statistical model
  • Local DataStore for historical usage accumulation

Feedback wanted

This is my first attempt at on-device predictive UX. Two things I'm actively grappling with:

  1. Model scope vs. accuracy: I'm deliberately keeping the model narrow (time-based patterns) to avoid permission sprawl. I'd love to hear from others who've tried adding signals like location or calendar overlap — what worked, what broke the battery.

  2. Detecting "out of pattern" periods: The model learns habits, but habits break. Vacations, travel, sick days — how do you signal to an on-device model that "this week is different" without adding heavy heuristics or extra permissions? I'm wary of turning this into a full scheduling system, but ignoring those periods makes predictions worse for a chunk of the year.

I'd love to hear from other Android devs — especially anyone who's hit the Android usage history wall or tried on-device prediction.

Play Store: https://play.google.com/store/apps/details?id=com.nick.applab.habits