Skip to content

thechwal1/Ultron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ultron — Phase 1 (Foundation + Hardening)

Real Android Studio project. I can't compile it inside this chat sandbox (no Android SDK or internet there), so you'll build it on your own PC — about 10–15 minutes the first time.

What's in this build

  • Wake word ("Hey Ultron") via Picovoice Porcupine — offline, low battery, replaces continuous mic listening
  • Brain Router: Claude API when online, local rule-based responder when offline, automatic fallback if a call drops mid-request
  • Encrypted memory — SQLCipher-encrypted Room database, key stored in Android Keystore, never in plaintext
  • Kill switch — "Pause" button right on the persistent notification, instantly mutes the mic and stops the service
  • Battery exemption prompt — asks Android not to kill Ultron in the background (still needs a manual OEM step on some phones — see below)
  • Android TTS for replies (always offline)

What's new: live UI, face-reactive orb, floating overlay

  • Dark amber UI with a glowing animated orb (the signature visual) and a live scrolling chat transcript — you can now see everything Ultron hears and says, not just hear it
  • In-app API key settings — tap the gear icon, paste your Claude/Picovoice keys, no rebuild needed
  • "Open " voice commands work offline — e.g. "open WhatsApp," "open camera" — via Android's own app launcher, no special permissions beyond what's already declared
  • Face-reactive orb — while the app is open, the front camera (via on-device ML Kit) tracks head angle and the orb's core drifts toward wherever you're facing. This is head-pose based, not literal eye/pupil tracking — no standard on-device API does that reliably, but it reads as the orb noticing you. Needs the Camera permission; first run needs a moment online to download ML Kit's face model, fully offline after.
  • Floating overlay orb — tap "FLOAT" to get a draggable bubble that stays on top of other apps (like a chat head). Tap it to toggle listening on/off. Needs "Draw over other apps" permission — the button will send you to that settings screen the first time.
  • Voice tone — pitch and rate are tuned down slightly for a deeper, more deliberate sound. This is a plain parameter adjustment on Android's own TTS voice, not a clone of any actor's specific voice — that's not something to build, for both technical and rights reasons.

One deliberate limit: face tracking only runs while the app itself is open, not in floating/background mode. A continuously-running background camera would show Android's persistent camera-in-use indicator the whole time you're using other apps, drain battery fast, and cross into "this looks like spyware" territory — not a good trade for a personal assistant. The floating orb still reacts to voice state, just not your face.

Building From Your Phone (No PC) — recommended for now

GitHub will build the APK on their servers; your phone just needs a browser and Termux (a terminal app) to push the code once. Nothing heavy runs on your phone itself.

  1. Install Termux from F-Droid, not the Play Store version (it's outdated): https://f-droid.org/packages/com.termux/
  2. In Termux, install git and unzip:
    pkg update && pkg install git unzip
    termux-setup-storage
    
    (approve the storage permission prompt)
  3. Unzip the project (adjust the path if your file landed somewhere other than Downloads):
    cd ~/storage/downloads
    unzip UltronApp_Phase1.zip -d ~/ultron-build
    cd ~/ultron-build/UltronApp
    
  4. Create a GitHub account (github.com, works fine in a mobile browser) if you don't have one, then create a new empty repository — don't check "add a README" — e.g. named ultron-assistant.
  5. Push the code from Termux:
    git remote add origin https://github.com/YOUR_USERNAME/ultron-assistant.git
    git branch -M main
    git push -u origin main
    
    GitHub will ask for a username and password — use a Personal Access Token instead of your password (Github password auth is disabled): GitHub website > Settings > Developer settings > Personal access tokens

    Generate new token (classic), tick the "repo" scope, copy it, paste it as the password when Termux asks.

  6. Add your API keys as GitHub Secrets (not committed to the repo, kept private): on the repo page > Settings > Secrets and variables > Actions

    New repository secret. Add two:

    • CLAUDE_API_KEY
    • PICOVOICE_ACCESS_KEY
  7. Check the build: repo page > Actions tab > you'll see "Build Ultron APK" already running (it triggers automatically on push). Wait a few minutes, then open the completed run and download the ultron-debug-apk artifact from the bottom of the page.
  8. That download is a zip containing the real .apk. Extract it with any file manager app, tap it, and allow "install unknown apps" for whichever app you used to open it.

Every time you want a new build (after we add a phase), just repeat step 3 onward with the updated zip I give you — git add -A && git commit -m "update" && git push inside ~/ultron-build/UltronApp re-triggers the cloud build automatically.

Alternative: building fully on-device with Termux

It's technically possible to install the full Android SDK inside Termux and skip GitHub entirely, but it needs ~2GB of downloads, is slower, and is more prone to device-specific breakage. The GitHub Actions route above is more reliable, so I'd stick with that unless you specifically want zero cloud dependency — let me know if you'd rather go that route and I'll write it up.

Setup (once you're back on a PC, for Android Studio)

  1. Install Android Studio: https://developer.android.com/studio
  2. Open the UltronApp folder as a project, let Gradle sync
  3. Get an Anthropic API key: https://console.anthropic.com
  4. Get a free Picovoice AccessKey: https://console.picovoice.ai
  5. On the Picovoice console, train a custom wake word "Hey Ultron" for the Android platform — downloads a .ppn file
  6. Put that file at app/src/main/assets/hey-ultron_android.ppn (matching the wakeWordAssetPath in UltronForegroundService.kt — rename either the file or that string so they match)
  7. Create local.properties in the project root with:
    CLAUDE_API_KEY=sk-ant-your-key-here
    PICOVOICE_ACCESS_KEY=your-picovoice-key-here
    
  8. Connect your phone (USB debugging on) or use an emulator, click Run ▶

OEM battery whitelisting (do this once, manually)

The in-app prompt handles the standard Android dialog, but Samsung, Xiaomi, OnePlus, and a few others have their own extra battery managers on top of stock Android that can still kill Ultron. Check your phone's steps at https://dontkillmyapp.com — usually it's Settings > Battery > find Ultron > "Don't optimize" / "No restrictions."

Try it

  • Launch the app, tap Start Ultron, grant permissions, allow the battery exemption dialog
  • Say "Hey Ultron," then your command — with signal, it replies via Claude
  • Turn on Airplane Mode, try again — replies locally instead of going silent
  • Tap Pause on the notification any time to kill the mic instantly

If the wake word isn't set up yet

Ultron won't crash — it logs that setup is incomplete and you can still talk to it after tapping Start in the app. The spoken "Hey Ultron" trigger just won't work until the .ppn file and access key are both in place.

Known limits in this phase (later phases add these)

  • Offline mode only understands a few simple patterns
  • No notification reading, app control, or auto-reply yet
  • No custom app icon yet (cosmetic, low priority)

Rollback points

This project is a git repo. git log --oneline shows each phase as a separate commit, so you can always roll back if something breaks.

Next

Tell Claude which phase to build next: notification reader, app control, auto-reply, or call handling.

About

Ultron — a personal AI voice assistant for Android, built in phases with Claude. Hybrid online/offline brain (Claude API + local fallback), wake word, encrypted memory, and app control on the roadmap.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages