There is something oddly satisfying about controlling a small device remotely from another small device. To do this with a headless Pi and a smartphone, all we need is a Wi-Fi adapter on the Pi with SSH running and a remote control app for the phone that knows how to send commands through an SSH connection. In this example, we'll focus on an Android phone, but there's a similar app for iPhone called NetIO (http://netio.davideickhoff.de). You could also use a regular SSH client app and make use of aliases and other shortcuts to quickly send commands to the Pi.
We'll be using an application called Coversal—Linux Remote Control.