AirSlice (com.anasdev.fluxlink) is an offline-first, embedded HTTP file server and low-latency media streaming engine for Android. It transforms any Android device into a zero-configuration cloud workspace and video streaming server accessible from any desktop or mobile browser over local Wi-Fi or Direct Mobile Hotspot—requiring zero internet connection, zero cables, and zero client software installation.
ClipboardSessionStore) holding up to 50 items (max 256 KB per item) with zero disk persistence and automatic wipe on server stop.OFF (sync disabled), RECEIVE_ONLY (privacy shield: phone receives from browser, phone clips never exposed to web clients), and TWO_WAY (seamless bidirectional real-time sync).execCommand HTTP fallback, and quick-clear controls.ACTION_SEND text/plain), notification quick-action trampoline (ClipboardCopyReceiver), and privacy filters guarding against EXTRA_IS_SENSITIVE clips.textContent DOM nodes, Cache-Control: no-store headers, and IP sliding-window rate limiter (30 clips/min).HotspotClientTracker). When Mobile Hotspot is turned on with no clients connected, the topbar network pill intelligently indicates Wi-Fi Router mode if connected to Wi-Fi, preserving the Hotspot hint and settings shortcut.HostUrlChangeHandler) upon network transitions or IP changes. Automatically revokes pairing tokens, clears authenticated web cookies, and wipes pending connection approval requests to prevent stale cross-network session hijacking.HomeViewModel to MainActivity using by viewModels() (Hilt-injected Activity scope) to support Android Share Sheet intents and notification actions directly in standard Activity lifecycle callbacks (onCreate and onNewIntent) with full Hilt DI support and seamless Jetpack Compose state observation.onTaskRemoved lifecycle handling in ServerForegroundService to safely tear down the active server engine, release hardware wake locks, and remove foreground notifications when the user swipes the app away from recent tasks.ServerExitConfirmDialog and ServerInspectorDialog with IntrinsicSize.Min, fillMaxHeight(), and calibrated optical centering offsets in Landscape mode, ensuring title, icons, status badges, and action buttons remain balanced on all screen aspect ratios.Dispatchers.IO, modernized boundary clamping with Kotlin .coerceAtMost(), and refined exception filtering for cleaner server diagnostics.[dir="rtl"] bi-directional layout adaptation.ZIP button labels with an explicit Download Folder prompt. Initiating folder or batch downloads now opens an interactive confirmation dialog with data-size warnings to prevent accidental large downloads on mobile.pushState / popstate). Pressing the Android hardware or gesture Back button now smoothly navigates up the directory hierarchy and dismisses open modal dialogs (lightbox/confirmation) instead of exiting the browser.com.google.zxing:core:3.5.3). Supports instant phone camera recognition with proper hollow-ring finder patterns (7x7 outer ring, 5x5 white ring, 3x3 inner square) and seamless one-scan browser auto-authentication.-dontobfuscate), dropping the Release APK size from 75 MB down to 3.51 MB.Modifier.graphicsLayer (Draw-phase execution with 0 recompositions) and encapsulated the 1-second server uptime ticker into an isolated @Composable element.RGB_565 bitmap configuration for in-memory subsampled image thumbnail decoding with explicit bitmap recycling to prevent GC pauses and memory spikes.148.dp) with a pulsing halo ring in Stopped mode that smoothly morphs (AnimatedContent + spring) into a top-docked Translucent Glassmorphic Status Bar with a 1-tap Circular Red Stop Button (48.dp), centered live Server Uptime Timer (MM:SS), and interactive PIN Badge..files, Custom Server Port 1024..65535, Keep Screen On), and an About section with developer & GitHub repository links.AppCompatDelegate.setApplicationLocales) with automatic RTL/LTR layout flipping, strict ASCII numeral enforcement (0-9) via LocaleList("en"), and auto-mirrored vector icons (Icons.AutoMirrored).Video_2.mp4 before Video_10.mp4).Semaphore(8)) in-memory WebP thumbnail generation with two-pass RGB_565 subsampling and zero phone storage overhead.4K/1080p videos (.mp4, .mkv, .webm, .mov) directly from phone flash storage to an HTML5 <video> player with instant timeline scrubbing (FileChannel / byte-range seeking in less than 1ms) and O(1) memory footprint.FileChannel transfers, a pre-allocated 512 KB direct memory buffer pool (DirectBufferPool), and 1 MB TCP socket buffers to sustain 15–22+ MB/s wireless transfer speeds..zip archive (ZipOutputStream) without writing temporary files to phone storage.NetworkInterface entries (ap0, swlan0, wlan0, 192.168.43.x) and prioritizes Direct Hotspot (Turbo Mode) over standard home routers to bypass wireless half-duplex hairpinning.▶ Streaming, ⬇ Downloading, ⬆ Uploading, 👁️ Viewing, 📁 Browsing, Online • Idle) and a 1-tap Session Kick/Revoke button.assets/ with dark-mode glassmorphism UI, client-side live search filter, interactive media theater lightbox modals, image carousels, multi-file selection with a floating batch bar, and a live upload speed/ETA meter (MB/s + ETA).| Telemetry Metric | Measured Value (com.anasdev.fluxlink) |
Architectural Reason |
|---|---|---|
| Release APK Size | 3.51 MB (Down from 75 MB) |
Custom standalone Material vector assets paired with crash-proof R8 code/resource shrinking (-dontobfuscate). |
| App CPU Usage | ~8% – 10% |
OS-level NIO Zero-Copy (FileChannel) offloads packet transfer directly to the Linux kernel, keeping JVM user-space CPU usage minimal. |
| Memory Footprint (3 GB Transfer) | 92 MB (Background) / 135 MB (UI Active) |
Strict O(1) streaming pipeline. Pre-allocated DirectBufferPool (reusable 512 KB direct buffers) prevents heap expansion regardless of file size. |
| Garbage Collection (GC) Events | 0 GC pauses during video scrub/stream | Pre-allocated direct buffer reuse and Draw-phase graphicsLayer animations eliminate allocation churn and JVM GC pauses. |
| Background Process Survival | Zero throughput drop when app is backgrounded | Powered by an Android Foreground Service holding a PARTIAL_WAKE_LOCK and WIFI_MODE_FULL_LOW_LATENCY hardware lock. |
AirSlice follows Clean Architecture + MVVM with reactive Kotlin StateFlow state management:
com.anasdev.fluxlink
├── data
│ ├── NetworkInfoProvider.kt # Hotspot vs Wi-Fi interface scoring & callbacks
│ ├── HotspotClientTracker.kt # Android 11+ ARP & HTTP client tracker for hotspot detection
│ ├── HostUrlChangeHandler.kt # Graceful teardown of sockets, sessions, & rate limiters on URL change
│ ├── LocalServerEngine.kt # Embedded HTTP Server Engine, HTTP 206 Range Streamer, ZIP Streamer
│ ├── ClipboardSessionStore.kt # In-memory thread-safe FIFO clipboard repository (50 items, RAM-only)
│ ├── AndroidClipboardBridge.kt # System clipboard manager bridge & notification fallback generator
│ ├── ClipboardCopyReceiver.kt # BroadcastReceiver trampoline for notification 1-tap copy
│ ├── ClipboardRateLimiter.kt # IP-based sliding window rate limiter for clipboard pushes
│ ├── SecurityManager.kt # Dynamic 4-Digit PIN & Session Cookie Auth
│ ├── ConnectionApprovalManager.kt # 1-Tap Approval State Machine
│ ├── ConnectedSessionManager.kt # Live Client Session & Real-Time Activity Tracking
│ ├── FileAccessTracker.kt # Thread-safe in-memory file & folder access tracker
│ ├── ThumbnailGenerator.kt # Concurrency-Bounded In-Memory RGB_565 WebP Thumbnail Generator
│ ├── DirectBufferPool.kt # Zero-GC 512 KB Reusable Direct Buffer Pool
│ ├── ServerDispatchers.kt # Workload isolation via dedicated coroutine dispatchers
│ ├── LockManager.kt # CPU WakeLock + Low-Latency Wi-Fi Lock
│ ├── FileManager.kt # Directory metadata, MIME mappings, path-traversal validation
│ ├── VideoStreamDataSource.kt # O(1) RandomAccessFile / FileChannel Range Streamer
│ └── QrCodeGenerator.kt # Pure Kotlin QR Code bitmap generator
├── domain
│ ├── model # NetworkState, DirectoryContent, FileMetadata, ServerStatus, ClipboardItem, AppTheme, AppLanguage
│ └── repository # NetworkRepository, ServerRepository, SessionRepository, SettingsRepository
├── service
│ └── ServerForegroundService.kt # Foreground Service, Notification, WakeLock & WifiLock lifecycle
├── presentation
│ ├── MainActivity.kt # Main Activity Entrypoint, Share Sheet Handler & Keep-Screen-On Flag Manager
│ ├── ClipboardPushActivity.kt # Transparent Trampoline Activity for native Share Sheet & Push Actions
│ ├── navigation/AppNavigation.kt # NavHost with custom slide + fade transitions
│ ├── state/HomeViewModel.kt # Unidirectional UI State, Shared Clipboard State & Intent handling
│ ├── state/SettingsViewModel.kt # Settings StateFlows & Preferences Mutators
│ ├── ui/screens/HomeScreen.kt # Morphing Power Control, Adaptive Layout, Connected Devices, Clipboard Card
│ └── ui/screens/SettingsScreen.kt # Material 3 Categorized Settings & About Section
└── assets/web # Offline Single-Page Web Application (HTML5 / CSS3 / ES6 Vanilla JS)
Developer: Anas Muhammad
GitHub Repository: EngAnasMuhammad/AirSlice