Skip to content

AILIFE-4798/RTOSify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

362 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RTOSify β€” Phone & Watch Companion

Mirror your phone's world to your wrist. Notifications, files, health, media, calls, and more β€” all in sync, over any connection.


Table of Contents


What is RTOSify?

RTOSify is a two-app Android system that bridges your Android phone and an Android-based smartwatch. The Phone App runs on your phone and captures everything β€” notifications, health data, media, calls, and files. The Watch Companion App runs on your smartwatch and displays or controls it all.

The two apps communicate over Bluetooth, BLE, WiFi (LAN), or the internet (WebRTC) β€” automatically choosing the best available link.

πŸ“Έ Screenshot here: Side-by-side of the phone's main dashboard (MainActivity) and the watch's main dashboard showing a connected state and device info.


Requirements

Item Minimum
Phone Android 8.0+
Watch Android 6.0+
Bluetooth Classic BT 2.0+ or BLE 4.0+
Optional Shizuku or root for advanced features

Both devices must have the apps installed. The phone uses the RTOSify app; the watch uses the RTOSify Companion app.


Getting Started

1. Install both apps

  • Install RTOSify on your Android phone.
  • Install RTOSify Companion on your Android smartwatch.

2. Pair the devices

On your phone:

  1. Open RTOSify β†’ tap Get Started.
  2. Grant the requested permissions (Bluetooth, Location, Notifications).
  3. The app will scan for nearby devices. Select your watch, or tap Scan QR Code to scan the QR code shown on the watch.

On your watch:

  1. Open RTOSify Companion β†’ tap Get Started.
  2. Grant permissions.
  3. The watch displays a QR code β€” scan it from the phone to pair instantly.

Once paired, the main dashboard shows a green connected indicator with your device name. You're ready.

πŸ“Έ Screenshot here: WelcomeActivity on the phone and WelcomeActivity on the watch side-by-side. Include the QR code pairing screen generated by the watch app.


Features

Notification Mirroring

The core feature of RTOSify. Every notification that arrives on your phone is forwarded to your watch in real time.

What you can configure:

  • Enable/disable per app β€” choose exactly which apps send notifications to your watch via an app selection list.
  • Wake on notification β€” turn on the watch screen when a notification arrives.
  • Wake during Do Not Disturb β€” allow notifications to bypass DND for important apps.
  • Notification style β€” multiple display styles to match your watch UI.
  • Vibration β€” enable or disable, adjust strength, and set custom vibration patterns. Works even in silent mode if enabled.
  • Sound β€” pick a notification sound played on the watch.
  • Notification actions β€” reply inline from the watch or dismiss a notification and have it dismissed on the phone simultaneously.

πŸ“Έ Screenshot here: NotificationSettingsActivity showing the master toggles and vibration sliders. Also the app selection list in NotificationAppListActivity.


Dynamic Island

A floating notification bubble that appears at the top of the watch screen for incoming notifications β€” without interrupting what you are doing.

Configurable options:

  • Enable or disable the Dynamic Island overlay.
  • Customize bubble color with a built-in color picker.
  • Blacklist specific apps so they never appear in the bubble.
  • Control auto-dismiss timing.

πŸ“Έ Screenshot here: The Dynamic Island bubble shown over a running app on the watch. The color picker in DynamicIslandColorPickerActivity.


Screen Mirroring

See your phone's screen live on your watch and control it remotely.

  • Live video feed encoded in H.264 and transmitted over the active connection.
  • Touch input: tap and swipe on the watch display to control the phone.
  • Navigation buttons: send Back, Home, and Recent Apps commands remotely.
  • Resolution control: adjust quality vs. bandwidth to suit your connection.
  • Works best over WiFi (LAN) for smooth, high-quality mirroring.

πŸ“Έ Screenshot here: MirrorActivity on the watch showing the phone screen being mirrored. MirrorSettingsActivity showing resolution and touch options.


File Manager

A full remote file manager to browse, transfer, and manage files between your phone and watch.

  • Browse: navigate the watch filesystem from your phone.
  • Upload / Download: transfer any file in both directions.
  • Rename, copy, move, delete: full file operations on remote files.
  • Transfer queue: multiple transfers handled simultaneously with real-time progress.
  • Share to Watch: share any file from any app using the standard Android share sheet β€” it goes straight to the watch.
  • Share to Phone: send files from the watch back to the phone.

πŸ“Έ Screenshot here: FileManagerActivity with a directory listing open, and the file transfer progress dialog visible.


Health Monitoring

RTOSify reads health sensor data from your watch and displays it on your phone with interactive charts.

Tracked metrics:

  • Steps β€” daily, weekly, and monthly counts with a goal progress bar.
  • Heart rate β€” current reading and historical trend graph.
  • Blood oxygen (SpO2) β€” current and historical chart.
  • Measure now β€” request an immediate sensor reading from the phone at any time.

All data is stored locally and browsable by date.

πŸ“Έ Screenshot here: HealthDetailActivity showing the steps chart and the summary cards (steps, heart rate, SpO2) at the top.


Battery Monitoring

Deep battery statistics for your watch, visible and tracked from your phone.

  • Real-time metrics: percentage, charging status, voltage, temperature, current draw (mA), and instant power (mW).
  • Estimated remaining time based on the current drain rate.
  • Historical charts: battery level and current draw plotted over time.
  • Alerts: notify when fully charged, or set a custom low-battery threshold with a slider.
  • Custom capacity: enter your watch's actual mAh for accurate time-remaining estimates.

πŸ“Έ Screenshot here: BatteryDetailActivity showing the metrics cards at the top, and the dual line charts for level and current draw below.


Media Control

Control media playing on your phone directly from your watch.

  • See the track title, artist, and album art on your watch.
  • Play / pause, skip forward/back, and seek through tracks.
  • Volume indicator showing the current level.
  • Real-time updates β€” changes on the phone reflect on the watch instantly.
  • A Media Widget is also available for your watch home screen for one-tap control.

πŸ“Έ Screenshot here: MediaControlActivity on the watch showing album art, track info, and transport controls.


Call Handling

When your phone rings, your watch knows about it.

  • Incoming call display: caller name (from contacts) or number shown on the watch with Accept and Reject buttons.
  • Answer or reject calls from the watch.
  • Dialer: a full numeric keypad on the watch to place outgoing calls through your phone.
  • Contact search: browse and search synced phone contacts directly from the watch dialer.

πŸ“Έ Screenshot here: CallActivity on the watch showing the incoming call UI. DialerActivity showing the numeric keypad and contact search.


Alarm Sync

Manage alarms on your watch from the phone, or create them on the watch itself.

  • Create, edit, and delete alarms from either device.
  • Set repeat days (Mon–Sun), custom labels, and times.
  • Changes sync instantly over the connection.
  • When an alarm fires, the watch shows a full-screen alarm UI with snooze (10 minutes) and dismiss options.

πŸ“Έ Screenshot here: AlarmManagementActivity on the phone showing the alarm list. AlarmRingingActivity on the watch showing the full-screen alarm.


Find Device

Lost your watch somewhere?

  • Tap Find Device on the phone to make the watch ring audibly.
  • The phone shows a proximity indicator (Excellent / Good / Fair / Weak / Very Weak) based on Bluetooth signal strength.
  • GPS distance is shown if location data is available.
  • Tap Stop to cancel the alarm remotely.
  • The watch can ring the phone back using Find Phone from the watch app.

πŸ“Έ Screenshot here: FindDeviceActivity on the phone showing the signal strength ring indicator and the Stop button.


Camera Remote

Turn your watch into a remote shutter for your phone's camera.

  • Live viewfinder: see the phone camera feed on the watch screen.
  • Capture photos by tapping the shutter button on the watch.
  • Record video with a live elapsed-time counter displayed on the watch.

πŸ“Έ Screenshot here: CameraRemoteActivity on the watch showing the camera preview and the capture button.


App Management

Manage the apps installed on your watch remotely from your phone.

  • View all installed apps on the watch, with version numbers.
  • Uninstall apps remotely without touching the watch.
  • Install APKs: send an APK from your phone to the watch β€” it transfers in chunks with checksum verification and installs automatically (requires Shizuku or root on the watch).

πŸ“Έ Screenshot here: AppListActivity showing the installed apps list with version numbers and an uninstall option.


Watch Face Management

Browse and install custom watch faces from a built-in store.

  • Watch Face Store: browse available watch faces with preview images.
  • Download and install watch faces directly from the store to the watch.
  • File browser: manage locally stored watch faces and swap between them.

πŸ“Έ Screenshot here: WatchFaceActivity showing the store grid with watch face previews.


Terminal / Shell

For advanced users β€” execute shell commands on the watch directly from the phone.

  • Color-coded output distinguishes input, output, and errors.
  • Command history: scroll through previously used commands.
  • Working directory tracking: the terminal tracks your current directory as you cd around.
  • Permission levels:
    • Limited β€” standard Android APIs only.
    • Shizuku β€” shell (UID 2000) level with broader access.
    • Root β€” full root access (UID 0), requires a rooted device.

πŸ“Έ Screenshot here: TerminalActivity showing a terminal session with color-coded output and a command being typed.


Home Screen Widgets

Both the phone and watch support home screen widgets for at-a-glance information without opening the app.

Phone widgets:

  • Status Widget β€” watch connection status, battery level, and key info at a glance.
  • Health Widget β€” today's steps and last heart rate reading on your home screen.

Watch widgets:

  • Dashboard Widget β€” connection status and quick stats.
  • Notification Log Widget β€” scrollable list of recent notifications received from the phone.
  • Media Widget β€” now-playing info with a play/pause button.

πŸ“Έ Screenshot here: Phone home screen with the Status Widget and Health Widget. Watch home screen with the Notification Log Widget.


Automation

Set up automatic behaviors that run without any user interaction.

Automation What it does
Auto-start on boot RTOSify starts automatically when the device boots
Clipboard sync Copy on one device β€” paste on the other
Auto WiFi Automatically connects to known WiFi networks
Auto mobile data Toggles mobile data based on rules
Bluetooth tether (PAN) Shares phone internet to the watch over Bluetooth
Force Bluetooth on Keeps Bluetooth enabled regardless of other settings
File observer Watches filesystem paths and triggers actions on file changes
Starred contacts sync Syncs the phone's starred contacts to the watch dialer

πŸ“Έ Screenshot here: WatchAutomationsActivity showing the full list of automation toggles.


Connection & Network Settings

RTOSify supports four communication transports, selected automatically based on the rules you configure.

Transport Best for
Bluetooth Classic Everyday use β€” reliable, always available
BLE (Bluetooth Low Energy) Battery-efficient background connection
WiFi / LAN High bandwidth β€” screen mirroring, large file transfers
WebRTC (Internet) When phone and watch are on different networks

Configurable rules:

  • LAN mode: Disabled / BT Fallback / App Open / BT-or-App / Always
  • Internet mode: Disabled / BT-or-LAN Fallback / App Open / Always
  • Fixed IP: manually set the watch's IP to skip discovery.
  • WebRTC servers: configure your own STUN/TURN servers.
  • Test connection: built-in internet connectivity tester to verify WebRTC works.

πŸ“Έ Screenshot here: NetworkSettingsActivity showing the transport status cards and the LAN/Internet rule dropdown selectors.


Permissions Explained

RTOSify requests several permissions. Here is what each one is actually used for:

Permission Why it is needed
Notification Access Read phone notifications to mirror them to the watch
Bluetooth Core communication between phone and watch
Location Required by Android for Bluetooth and WiFi device scanning
Do Not Disturb Access Respect or bypass DND when forwarding notifications
Battery Optimization Exemption Keep the background service alive for a persistent connection
Overlay / System Alert Window Draw the Dynamic Island bubble over other apps
Contacts & Calendar Sync starred contacts and calendar events to the watch
Camera Camera Remote feature
Phone State Detect incoming calls to forward them to the watch
Accessibility Service Required for some automation features
Shizuku / Root (optional) APK install, advanced file ops, WiFi/data control, shell

πŸ“Έ Screenshot here: PermissionActivity showing the permission checklist with granted/denied states.


FAQ

Q: Do both devices need to be on the same WiFi? No. The apps use Bluetooth when nearby. You can configure them to fall back to internet (WebRTC) when apart. See Connection & Network Settings.

Q: Can I use RTOSify without Shizuku or root? Yes. Most features work without elevated privileges: notifications, health, media, calls, screen mirroring, find device, and more. Shizuku/root unlocks APK installation on the watch, WiFi/data control, and the shell terminal.

Q: Does screen mirroring drain battery? Screen mirroring is intensive. Disable it when not needed and use it over WiFi for best performance. All other features are designed to be lightweight, especially in Lite Mode on the watch.

Q: Can I pair multiple watches? Yes. The phone app supports multiple paired devices. Switch between them from the main dashboard menu.

Q: My notifications stopped arriving on the watch.

  1. Check that Notification Access is still granted β€” Android can revoke it after OS updates.
  2. Check the specific app is enabled in the App Selection list.
  3. Verify the connection is active (green indicator on the dashboard).

Q: The connection keeps dropping. Enable Battery Optimization Exemption for both apps and turn on Aggressive Keep-Alive in Automation settings. If using Bluetooth Classic, try switching to BLE or enabling the Force Bluetooth toggle.


Developer Notes

Repository Structure

This repository contains two independent Android Studio projects. Do not open the root directory as a project in Android Studio.

rtosify/
β”œβ”€β”€ rtosify/      ← Open this for the Phone App
β”œβ”€β”€ companion/    ← Open this (in a separate window) for the Watch App
└── signaling-server/  ← Node.js WebRTC signaling server

Package names:

  • Phone: com.ailife.rtosify
  • Watch: com.ailife.rtosifycompanion

Build Commands

# Phone app
cd rtosify
./gradlew assembleDebug
./gradlew installDebug

# Watch app
cd companion
./gradlew assembleDebug
./gradlew installDebug

# Run unit tests (from either directory)
./gradlew test

Architecture Overview

  • Protocol.kt β€” shared JSON message protocol (130+ message types). Must be kept identical in both apps.
  • BluetoothService.kt β€” foreground service and top-level coordinator. Receives from TransportManager and dispatches via handleReceivedMessage().
  • TransportManager.kt β€” pluggable multi-transport layer. Auto-selects transport based on configured rules and applies encryption before sending.
  • EncryptionManager (security/) β€” encrypts all messages in transit.
  • IUserService.aidl β€” AIDL interface for Shizuku/root operations. Must match exactly between both apps.

Communication Transports

Class Transport
BluetoothTransport Classic BT RFCOMM (UUID 00001101-0000-1000-8000-00805f9b34fb)
BleTransport BLE GATT with chunked data transfer
WifiIntranetTransport TCP socket, mDNS/NSD discovery
WebRtcTransport WebRTC P2P with SignalingClient

Adding a New Message Type

  1. Add a constant to MessageType in Protocol.kt β€” in both apps.
  2. Add a data class if the message carries a payload.
  3. Add a factory method in ProtocolHelper.
  4. Handle the new type in BluetoothService.handleReceivedMessage() β€” in both apps.

Adding a New Transport

  1. Implement the CommunicationTransport interface (Transport.kt).
  2. Register the new transport in TransportManager.

Adding Shizuku / Root Features

  1. Add the method signature to IUserService.aidl β€” in both apps (must match exactly).
  2. Implement it in UserService.kt.
  3. Rebuild to regenerate AIDL stubs.
  4. Call via the Shizuku binder from app code.

Key Dependencies

Library Purpose
Kotlin Coroutines Async operations throughout
Gson JSON serialization of protocol messages
Shizuku API Elevated privilege (shell/root) operations
libsu Root shell access
ZXing QR code generation and scanning for pairing
CameraX Camera Remote feature
MPAndroidChart Health and battery charts (phone app)
Jsoup Watch face store HTML parsing (phone app)

Internationalization

User-facing strings are in res/values/strings.xml (English) with Chinese translations in res/values-zh/strings.xml. All code comments and log messages are in English.

Related READMEs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors