Through My Eyes
by Aloys Akkerman and Joost Koehoorn
The idea
Our idea was to create an innovative and interactive way to control Google StreetView running on a desktop browser from an iPhone. For this we thought of two different use cases, one being controlling the StreetView interface right in front of your screen by utilizing the iPhone's gyro-meter. The second, more interactive use case is being able to see someone's environment while (s)he is traveling across the globe. This allows for directly being able to see imagery that Google has available for the user's location.
For the second use case, where someone is being tracked from a (possibly far) distance, we added taking photos on the iPhone which can then be send to the browser, and vice versa someone using the browser can indicate where the user needs to go by drawing a route on a Google Map. Simple text-based chatting is also available.
Features
- Controlling StreetView with gyro-meter and compass.
- iPhone can control multiple desktops at once.
- Support for multiple sessions on the same server. This allows for using one server to handle multiple connections.
- Connect to a session by scanning a QR code or sending an email with identifier URL.
- Text chatting.
- Drawing of route over a Google Map.
- Taking photos on iPhone to send to browser.
Implementation
For realtime interaction we needed a constant connection between the iPhone and the browser. For this we used the very recent WebSocket protocol which allows for keeping a connection open from the browser to a server. For the browser we used CoffeeScript to develop our application. The server was implemented in PHP and uses the Laravel framework for basic functionality and the Wrench library as WebSocket implementation.
On iOS we used the SocketRocket library to setup a WebSocket connection to the server. Also, the ZXing QR code library was used to decode QR codes on the fly. Programming for iOS is required to be done in Objective-C, which we both had experience with so that wasn't a problem. We designed a little protocol which both clients had to follow so they could request a session id, connect to a session, leave a session etc.
Problems
Overall, we didn't have many problems during the development of the system. At some point it became clear that the WebSocket implementation we used in the server was unstable and did not decode some of the packages correctly. Luckily, we were able to solve this problem by switching to a newer, beta version, renamed to Wrench. This solved our problem. We were also sometimes struggling with some weird crashes on the iPhone which could take a while of debugging for them to be resolved.
Possible improvements
The process of connecting to a session can be made much more user friendly. At first, a default server can be used instead of having to specify a host yourself. Connecting to a session can be replaced by creating a system where a user would have to register/login so he gains access to a list of his friends, just how current chat services work.
The behavior of the gyro-meter could also be vastly improved. For better results one would have to combine multiple sensors like the compass and accelerometer.