DEV Community

Droid2PC Team
Droid2PC Team

Posted on

Building Apple Continuity for Android: WebRTC, E2E Encryption, and Cross-Platform Sync

If you've ever used an iPhone with a Mac, you know the magic of Apple Continuity — answering calls on your laptop, copying text on your phone and pasting it on your computer, seeing notifications pop up seamlessly across devices. It's brilliant.

But if you're an Android user with a Mac or Windows PC? You're out of luck. That gap is exactly what we set out to fix with Droid2PC.

The Problem

Android has 72% of the global smartphone market, yet there's no native way to:

  • Receive phone calls on your computer
  • Read and reply to SMS from your desktop
  • Sync clipboard between phone and PC
  • Transfer files without cloud services
  • Mirror your phone screen

Microsoft's Phone Link works partially on Windows but doesn't support macOS. Samsung's solutions are limited to Galaxy devices. We wanted something universal.

Our Approach: Peer-to-Peer First

The core design decision was no cloud relay. All communication between your phone and computer goes through a direct WebRTC peer-to-peer connection.

Why WebRTC?

Phone (Android) <--WebRTC DataChannel--> Desktop (macOS/Windows)
        ↕                                        ↕
   STUN/TURN server (signaling only)
Enter fullscreen mode Exit fullscreen mode
  • Low latency: Direct connection means sub-10ms for clipboard sync
  • No bandwidth limits: File transfers aren't throttled by a relay server
  • Works on LAN: If both devices are on the same network, traffic never leaves your router
  • NAT traversal: STUN/TURN handles the edge cases

Connection Flow

  1. Devices discover each other via our signaling server (lightweight, only exchanges SDP offers)
  2. ICE candidates are gathered (local, STUN, TURN as fallback)
  3. DTLS handshake establishes the secure channel
  4. WebRTC DataChannels carry all app data

End-to-End Encryption: AES-GCM-256

Even though WebRTC provides DTLS encryption at the transport layer, we added an application-layer E2E encryption using AES-GCM-256.

Why double up? Because:

  • TURN relay servers can theoretically inspect traffic in DTLS-SRTP mode
  • We wanted zero-knowledge architecture — even we can't read your data
  • Users needed to trust that SMS content, call audio, and files are truly private

Key Exchange

1. Devices pair using QR code (contains public key)
2. ECDH key agreement generates shared secret
3. HKDF derives AES-256 key from shared secret
4. All messages encrypted with AES-GCM (authenticated encryption)
Enter fullscreen mode Exit fullscreen mode

Each session generates new ephemeral keys, providing forward secrecy.

Feature Architecture

Notifications

The Android app uses NotificationListenerService to capture notifications and forwards them over the encrypted DataChannel. The desktop app renders native notifications (macOS UNUserNotificationCenter, Windows ToastNotification).

SMS

Uses Android's SmsManager and content provider to read/send messages. The desktop client provides a chat-like interface for conversations.

Phone Calls

This was the hardest part. We use Android's ConnectionService API to bridge calls, streaming audio over a WebRTC audio track with Opus codec for low-latency voice.

Clipboard Sync

Monitors clipboard changes on both platforms and syncs immediately over DataChannel. Supports text, images, and rich content.

File Transfer

Chunked transfer over DataChannel with resume support. No file size limits — we've tested with 50GB+ files.

Tech Stack

Component Technology
Android Kotlin, Jetpack Compose
macOS Swift, AppKit
Windows C++, WinUI 3
Networking WebRTC (libwebrtc)
Encryption AES-GCM-256, ECDH, HKDF
Audio Opus codec via WebRTC

Try It Out

Droid2PC is free to use with core features. Premium unlocks advanced capabilities like screen mirroring and app launching.

What's Next

We're working on:

  • Linux desktop client
  • Multi-device support (connect multiple phones)
  • WebRTC Insertable Streams for even stronger encryption
  • Better screen mirroring performance with hardware encoding

If you're building cross-platform communication tools, I'd love to hear about the challenges you've faced. Drop a comment below!

Top comments (0)