Live Sync
Engine

Advanced IPC architecture using secondary executables for dedicated socket bridging. Facilitates high-performance, bidirectional event streaming between Android services and Windows.

ADB Intent Trigger Reverse TCP Socket Lifecycle Binding
adb_devices.exe
Spawns
🎵 media_server.exe
🔔 notification_server.exe

⚙️ Process Lifecycle & Initialization

To maintain stability and non-blocking UI in the main application, media and notification listeners are offloaded to separate child processes.


01

Process Orchestration

The main engine adb_devices.exe spawns two dedicated child executables: media_server.exe and notification_server.exe
This isolation ensures the main UI remains non-blocking.

02

Socket Initialization

Both child processes immediately initialize their own independent TCP Socket Servers on distinct ports and enter a listening state, awaiting incoming connections.

03

Android Handshake Trigger

Once the Windows application is ready and listening, it sends explicit handshake commands to the Android device. These commands instruct the Android background services to establish socket connections and begin streaming data.

http://$android_ip:$port/start_socket_io_for_media_sessions http://$android_ip:$port/start_socket_io_for_notifications
04

Reverse Connection

Android receives the request and immediately establishes a TCP Connection back to the respective sub-executable (Media → Media Server, Notif → Notif Server).

05

Auto-Optimization & Lifecycle

Fail-Safe Closure: If the device disconnects, goes offline, or detects a network change (e.g., WiFi switch), the connection is automatically terminated on both sides. The Windows executables self-close to free up system resources instantly.

🔔 Notification Protocol
Android ➔ Server (Events)
notification Real-time event when a notification is posted.
"type": "notification",
"notification_id": "pkg|title|text",
"app_name": "WhatsApp",
"title": "Meta AI",
"text": "Hello world",
"sub_text": "Personal",
"when": 1700000000000,
"is_big_img": true,
"actions": [
  {
    "title": "Reply",
    "is_text_field": true
  }
]
notification_list Full sync sent on connection or set change.
"type": "notification_list",
"notifications": [ /* Array of notification objects */ ]
notification_update Sent when an existing notification becomes richer.
"type": "notification_update",
"notification": { /* Full object */ }
notification_removed Sent when a notification is dismissed.
"type": "notification_removed",
"notification_id": "...",
"app_package_name": "..."
Server ➔ Android (Commands)
resend_notifications Force refresh of all data.
{ "type": "resend_notifications" }
send_reply Trigger inline text reply.
"type": "send_reply",
"notification_id": "...",
"text": "I'll be there soon!"
action_click Trigger a standard button action by title.
"type": "action_click",
"notification_id": "...",
"title": "Mark as read"
🎧 Media Protocol
Android ➔ Server (Events)
core_info Main playback state. Sent frequently on metadata/state change.
"type": "core_info",
"package_name": "com.spotify.music",
"song_title": "Believer",
"song_subtitle": "Imagine Dragons",
"is_currently_playing": true,
"current_time": 45231,
"end_time": 204000,
"last_position_update_time": 1700000000123
app_icon Sent once per package or on reset.
"type": "app_icon",
"package_name": "com.spotify.music",
"app_icon_base64": "base64_png..."
album_art Sent only if track title/metadata changes.
"type": "album_art",
"song_title": "Believer",
"album_art_base64": "base64_jpeg..."
remove_info Sent when a media session ends.
"type": "remove_info",
"package_name": "com.spotify.music"
Server ➔ Android (Commands)
playback_cmd Transport controls.
"type": "playback_cmd",
"package_name": "com.spotify.music",
"cmd": "play" // play | pause | next | prev
seek_update Precise seek or relative skip.
// SEEK
{
  "type": "seek_update",
  "cmd": "seek_to",
  "position": 60000
}
// SKIP
{
  "type": "seek_update",
  "cmd": "skip",
  "value": 10000
}
resend_all Request full resync of media sessions.
{ "type": "resend_all" }