Alfred Cazares
← Back to the shelf
Shelved Last touched May 3, 2017

SmartLock

An Android app that opens a physical lock over Bluetooth — built across three repositories in four days, each one a visible iteration on the last.

JavaAndroidBluetooth RFCOMMGradle

A university project: an Android phone that unlocks a physical lock over Bluetooth. The first thing I built where a bug could be in the wiring rather than the code, and where “it compiles” and “it works” were clearly different claims.

It exists as three separate repositories because that is how I worked at the time — a new repo per attempt rather than a branch. In hindsight that accident left a readable record of the iteration, so I am keeping all three linked rather than tidying it into one.

The three steps

BlueToothEnabled — 5 April 2017. Just the radio. BluetoothAdapter discovery, enabling the adapter, enumerating paired devices. Permissions: BLUETOOTH and BLUETOOTH_ADMIN. No lock yet — this is proving I can see the device at all.

SmartLock — 1 May 2017. Adds the part that matters: opening an RFCOMM socket to the paired device and writing to its OutputStream to send the unlock command. Everything lives in MainActivity.

SmartLock2 — 3 May 2017. Two days later, the same functionality split across MainActivity and a dedicated lockActivity — device selection separated from lock control.

Why the third one is the interesting one

Nobody asked for that refactor. The app worked on 1 May. I split it up two days later because a single Activity holding both the Bluetooth pairing UI and the lock control had become annoying to reason about.

That is the earliest thing in my GitHub history I would still describe as an engineering decision rather than an assignment. It is a small one, and it is on the right instinct: the code worked, and it was still worth changing.