Introducing Lighthouse
I’m excited to announce the launch of Lighthouse — an open source Android library designed to simplify the discovery of SSDP devices on your network. Checkout the GitHub link here to dive right in.
SSDP stands for Simple Service Discovery Protocol — a network communication mechanism used for device and service discovery. Said devices may be smart TVs, speakers, internet-connected lights, and more. Because the protocol does not require any special configuration it works right out of the box — you already have multiple devices advertising on your network right now!
Although several proof-of-concept repositories and code samples exist, I wrote Lighthouse because I felt that there was room for improvement, specifically in the following areas:
- State management: Lighthouse maintains an internal list of all discovered devices on your network. When any device or embedded component updates — the new list will be emitted to the consuming application.
- Search models: Lighthouse exposes data classes for building and sending your own unicast and multicast M-SEARCH packets. No more annoying string concatenations!
- Modern tech stack: Lighthouse is written entirely in Kotlin and uses Kotlin Coroutines.
For the majority of readers wondering “This is…over-engineered to the moon and back, why would I use this?”, you’re right — a simple socket callback and text parsing is enough for most use-cases. However, this is a passion project of mine and I wrote the library for fun. So, for the 2.67 people genuinely thinking that they would love to use this in their projects— I sincerely thank you for your consideration. 🍪