Skip to content

Mahir-Agarwal/ConnectX-Android-Client

Repository files navigation

📱 ConnectX Android Client

A modern, cross-platform Android application powering real-time peer-to-peer WebRTC file transfers.

OverviewDemoFeaturesTech StackGetting Started

Android Kotlin WebRTC WebSocket License


📖 Overview

ConnectX Android is a beautifully crafted mobile application designed to instantly receive and send files from the ConnectX Web App using WebRTC-based peer-to-peer (P2P) file transfer.

No cloud storage, no intermediaries, and no waiting. Simply scan a QR code generated on the web client, and your Android device will establish a secure, direct connection for blistering-fast data transfer. Built using Jetpack Compose and modern Android architectures, ConnectX acts as the perfect companion client to our high-performance Spring Boot signaling backend.


🎥 Demo

Experience the seamless connection process and lightning-fast transfer across platforms:

Web View Mobile View
ConnectX Web Demo ConnectX Mobile Demo

Sharing files instantly and wirelessly via WebRTC data channel from both perspectives.


✨ Features

🔒 Direct & Secure

  • Peer-to-Peer Transfer: End-to-end encrypted transfer using WebRTC Data Channels.
  • Zero Cloud Storage: Files move directly between Web and Mobile, ensuring total privacy.
  • QR Code Connection: Secure authorization via ML Kit barcode scanning.

⚡ Lightning Fast

  • Local Network Speed: Bypasses the internet entirely if both devices share the same WiFi.
  • Real-Time Signaling: Instantly negotiated sessions using WebSocket and STUN/TURN relays.

🎨 Modern Android UI

  • Jetpack Compose: 100% Declarative UI with smooth, fluid animations.
  • Material 3 & Glassmorphism: Beautiful dark-themed aesthetic that feels premium.
  • Edge-to-Edge: Fully immersive system UI integration.

🏗️ Robust Architecture

  • Coroutines & Flows: Asynchronous data processing and state management.
  • MediaStore API: Safely writes incoming files directly to the Downloads directory.

🛠️ Tech Stack

Component Technology Description
Language Kotlin 1.9+ Primary language powering the Android client.
UI Framework Jetpack Compose Modern declarative UI toolkit for Android.
P2P Engine WebRTC Google's WebRTC library for raw P2P data channels.
Vision/Camera CameraX & ML Kit High-performance, low-latency barcode and QR scanning.
Networking OkHttp WebSockets Persistent duplex connection to the Signaling Server.
Serialization Kotlinx Serialization Fast, native JSON parsing for signaling payloads.

🧠 Application Flow

The ConnectX Android app communicates seamlessly with the Web Client and Backend Infrastructure:

  1. Open Web Client: User opens ConnectX Web and generating a receiving QR code.
  2. Scan using Android: User opens this app, grants camera permission, and scans the screen.
  3. Parse QR Data: ML Kit reads the ReceiverToken and SessionId.
  4. WebSocket Handshake: App establishes a WebSocket connection to the Spring Boot Signaling service.
  5. WebRTC Negotiation: The app and web client exchange OFFER, ANSWER, and ICE_CANDIDATES.
  6. P2P Transfer: A direct DataChannel opens, and binary file chunks stream directly to device storage.

🚀 Getting Started

Follow these steps to run the Android project on your local machine using Android Studio.

Running the Project
  1. Clone the Repository:

    git clone https://github.com/Mahir-Agarwal/ConnectX-Android-Client.git
    cd ConnectX-Android-Client
  2. Configure Network Environment: Open app/src/main/java/com/example/connectxapp/common/MobileEnv.kt (or your build config) and point the BASE_URL to your active backend signaling server.

    object MobileEnv {
        const val BASE_URL = "http://192.168.x.x:8080" // or your deployed backend URL
    }
  3. Build and Deploy: Open the project in Android Studio Hedgehog (or newer). Wait for Gradle sync, then connect a physical Android device (requires Android 7.0+ / API 24). Click Run.

    Note: Camera features and WebRTC P2P typically do not test well on emulators. A physical device is strongly recommended.


📂 Project Structure

m:\ConnectX-MobileApp
├── app/src/main/java/com/example/connectxapp/
│   ├── network/             # WebSocket connections & JSON Signaling Models
│   ├── storage/             # MediaStore Scoped Storage logic (FileWriterUtil)
│   ├── webrtc/              # WebRtcClient, ICE Candidate generation & DataChannels
│   └── ui/                  # Compose UI Elements
│       ├── components/      # Glassmorphic Buttons, Loaders, and Cards
│       ├── theme/           # Material 3 Color Schemes & Typography
│       ├── ScanScreen.kt    # CameraX & ML Kit QR Code Scanner
│       └── TransferScreen.kt# Active WebRTC File Receiving UI
├── Demo/                    # Application Demo GIFs
└── build.gradle.kts         # Dependency configurations

Engineered and Developed by Mahir Agarwal

About

A modern Android application for real-time peer-to-peer file transfers using WebRTC, Jetpack Compose, and QR-based connections.

Topics

Resources

Stars

Watchers

Forks

Contributors