An AI-powered Android file organization app β scan your storage, chat with Gemini AI, queue smart commands, preview every operation before it runs, and undo anything.
| Category | What it does |
|---|---|
| π§ AI Chat | Full multi-turn Gemini chat β ask in English or Swahili, get smart answers, code snippets, and queued command suggestions |
| ποΈ 40+ Commands | Organize by type/date, move media by source, delete duplicates, clean APKs, caches, WhatsApp junk, dev build outputs, and more |
| ποΈ Preview (Dry Run) | Every command builds an ActionPlan first β see exactly which files will move or be deleted, uncheck anything you want to skip |
| β©οΈ Undo | A persistent UndoLedger records every operation β tap Undo to reverse moves and restores from the in-app trash |
| ποΈ Soft Delete | Nothing is hard-deleted immediately β files go to Organized/.trash/ and are auto-purged after 30 days via WorkManager |
| π Dark Mode | Full dark/light theme β all colors are semantic tokens in ThemeManager, zero hardcoded hex values in layout code |
| π Action Cart | Quick-action chips, AI suggestions, and the command browser all add to the same queue β one unified "Confirm" flow |
| π Storage Stats | Live usage bar with used/free/total labels; color shifts orange β red as storage fills |
| π Skeleton Loading | Shimmer placeholder cards replace the old "scanningβ¦" text while indexing runs in the background |
(Coming soon β build and run on a physical device or emulator to see the UI)
| Home / Dashboard | AI Chat | Command Browser |
|---|---|---|
| Storage stats + Quick actions | Multi-turn Gemini chat | Searchable 40+ commands |
| Preview | Execution | Results + Undo |
|---|---|---|
| Per-file checkbox review | Live progress per command | Freed/moved summary + β© Undo |
app/src/main/java/com/willykez/fileorganizer/
β
βββ AppState.java β State machine: EMPTY Β· SCANNING Β· IDLE Β· STAGING Β· EXECUTING Β· RESULTS
βββ ThemeManager.java β Dark/light semantic color tokens + typography scale
βββ UIFactory.java β Unified component factory (3 button styles, chips, cards, skeleton shimmer)
β
βββ FileModel.java β File metadata + category classification (merged FileMetadata + FileCategoryDetector)
βββ StorageManager.java β Recursive scan, delta load, device StorageStats (merged StorageScanner + MetadataManager)
β
βββ ActionPlan.java β Dry-run model: list of PlannedOp (MOVE / SOFT_DELETE) with per-item toggle
βββ CommandEngine.java β Parse commands (offline regex + Gemini AI), buildPlan(), executePlan(), multi-turn chat
βββ CommandType.java β Enum of 40+ commands with emoji, description, category, cost, requiresRoot flag
β
βββ FileSystemRouter.java β Safety layer: move(), trash() β .trash/, restore(), purgeExpiredTrash()
βββ UndoLedger.java β Persistent undo stack (SharedPreferences JSON), push/pop snapshots
β
βββ AppUtil.java β IO helpers, SHA-256 hashing, formatSize, permissions (merged FileUtil + SketchwareUtil + PermissionsHelper)
βββ FileOrganizerApp.java β Application class, shared Gson instance
β
βββ MainActivity.java β State-driven UI: empty state Β· skeleton Β· dashboard Β· 5 bottom sheets
User Input (Quick Action / AI Chat / Command Browser)
β
addToCart(CommandType) β Action Cart (unified queue)
β
commandEngine.buildPlan() β Dry-run on background thread
β
Preview Sheet (user reviews) β Per-op checkboxes
β
commandEngine.executePlan() β FileSystemRouter (soft-delete safe)
β
undoLedger.push(reverseOps) β Persistent undo
β
Results Sheet + Snackbar
The β¨ AI FAB opens a full-screen Gemini-powered chat:
- Multi-turn context β full conversation history sent with every request
[SUGGEST:COMMAND_NAME]protocol β AI embeds a tag; app strips it from display and renders a tappable "AI Suggests β Queue" chip- "list all commands" β answered locally (instant, no API call) with categorized command list
- Code artifacts β triple-backtick blocks render with dark background, language label, monospace font, and a π Copy button
- Inline markdown β
**bold**,*italic*,- bulletrendered as styled Views - Typing indicator β three animated bouncing dots while AI responds
- Offline graceful fallback β replies helpfully without crashing when disconnected
- Clear chat β wipes history with a confirmation dialog
- Swahili support β offline keyword matcher handles Swahili commands natively
| Category | Commands (sample) |
|---|---|
| π Organize | By Type, By Date, Media by Source, Screen Recordings, Downloads by Date |
| π¦ Move | Screenshots, WhatsApp Images/Videos, Telegram, Audio, Videos, Documents, Large Files (>50 MB), Old Files (>180 days) |
| π§Ή Cleanup | Delete Duplicates (SHA-256), Empty Folders, Cache, APKs, Thumbnails, Temp Files, Crash Logs |
| π¬ Social | Clean WhatsApp Sent, TikTok Cache, Instagram Cache |
| π» Developer | Clean Gradle Cache, Remove node_modules, Clean Build Outputs |
| π Analysis | Find Largest Files (Top 25), Find Unused Files (1+ yr), Analyze Storage Breakdown |
| π€ Automation | Auto Organize Daily, Nightly Cleanup |
- Android Studio Hedgehog or newer
- JDK 8+
- Android device / emulator (API 21+)
- Gemini API key (included in source for demo β replace in production)
git clone https://github.com/Willykez/FileOrganizerAI.git
cd FileOrganizerAI
# Open in Android Studio and sync Gradleimplementation 'androidx.appcompat:appcompat:1.7.1'
implementation 'com.google.android.material:material:1.12.0'
implementation 'com.google.code.gson:gson:2.10.1'<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> <!-- Android 11+ -->
<uses-permission android:name="android.permission.INTERNET" />The Gemini API key is embedded for demo purposes. For production:
- Get a key at aistudio.google.com
- Move it to
local.properties:GEMINI_API_KEY=your_key_here - Reference it via
BuildConfig.GEMINI_API_KEYinCommandEngine.java
- MediaStore API scanning β query OS-indexed media instead of full directory crawl (10x faster)
- FileObserver delta updates β listen for changes and update cache incrementally
- Perceptual hashing (pHash) β detect near-duplicate images (burst shots, lightly edited)
- WorkManager trash purge β auto-purge
.trash/older than 30 days without blocking launch - SAF / StorageAdapter β full SD card support via Android's Document File API
- Room database β replace Gson JSON persistence for better query performance
- Batch AI renaming β send 50 files per Gemini request for smart rename suggestions
- Root commands β isolated
RootShellContextfor Dalvik cache wipe, etc. - Widget β home-screen storage usage widget
MIT License β Copyright (c) 2025 Willykez
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software to use, copy, modify, merge, publish, distribute, and/or
sell copies of the Software, subject to the standard MIT terms.
Built with β€οΈ for East African Android users Β· Swahili-first design