Digging into the Code

Opening up the index.php file and following along with the code is extremely beneficial if you plan to develop your own Google Glass application. Reading through, there are enough properly named variables, functions, and comments to get a good idea of what’s going on. What we’re going to do now is use index.php’s code to create our own, new feature: sending a random quote to Glass.

The first thing to do is create a new file in the same folder as index.php and call it random.php. This will be the page we access to send the quote to Glass. Next, add the following code to random.php. These are lines 19-37 in index.php, and they include all of the config information, Mirror API files, and create a connection to the Mirror API; ...

Get Web Designer’s Guide to Google Glass now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.