It was a time when everyone was stuck at home due to COVID. I thought it would be nice to watch YouTube together with friends even when apart. I found the Android 11 Hackathon hosted by GDG Korea Android — a roughly three-week event. I entered solo.
The Service
YouTube Together was an app for watching YouTube videos simultaneously with friends, remotely.
The YouTube viewing feature worked like the official YouTube app. Users searched and played videos through the YouTube API. A mini player allowed browsing other content while a video played.
The core was simultaneous viewing. After adding friends and selecting a video, playback started for everyone at once. Playback position and play/pause state synced in real time. Chat let participants talk while watching.
Architecture
Finishing in three weeks required a proven structure. The app followed the MVVM pattern — Single Activity with Fragments, dependency injection via Hilt. ViewModel and LiveData managed UI state, and the Repository pattern separated local (SQLite) and remote data sources.
Two servers handled the backend: a Spring-based API server for REST calls, and a Java socket server for real-time synchronization.
flowchart TD
Hilt["Hilt\n(DI)"] -. Dependency injection .-> App
subgraph App["Application"]
Activity["Single Activity\n+ Fragment"] --> VM["ViewModel\n+ LiveData"]
VM --> Repo["Repository"]
end
Repo --> Local["Local Model\n(SQLite)"]
Repo --> Remote["Remote Data Model"]
Remote --> Socket["Socket Server\n(Java)"]
Remote --> API["API Server\n(Spring)"]
Core Implementation
YouTube API Integration
I implemented video search and playback using the YouTube Data API. The playback screen used Motion Layout for mini player transitions. Swiping down minimized to a mini player; tapping again returned to full screen.
Real-time Simultaneous Viewing
The key to simultaneous viewing was playback state synchronization. I built a socket server in Java that synced playback position and play/pause state across participants in real time. When one user changed position, everyone else’s video jumped to the same point. Chat ran through the same socket connection.
Retrospective
Three weeks might not sound short, but it was tight for building both server and app alone. I had to juggle API server design, socket server implementation, and Android app development all at once. Scoping down and focusing on the core was the key — I cut community features and recommendations, concentrating on simultaneous viewing alone.
I won the Daedoseogwan Award. Three weeks that started from one idea — watching together even when apart. Looking back, the core lesson of the hackathon was the experience of scoping down under time pressure and carrying it through to completion.