Missing the train by just a minute is mildly frustrating. Every time I see the train roll away from the platform as I walk towards the station makes me wonder what if I had walked a little bit faster or paced up the escalator. (This dilemma keeps me up at night)
Of course there are plenty of cool mobile apps with public transport timetables but pulling out a phone and fiddling about while I’m walking is more trouble than its worth.
After two nights of hacking, I can now access Melbourne’s bus, train and tram timetables while I’m walking to the station with voice and geolocation, thanks to my Google Glass app PTVGlass! I’ll be the Glasshole shouting “trams near me” in the city.
Download the source code
Unfortunately I know the number of Google Glass Explorers in Melbourne will be in the single digits so this app has very little commercial value. I’m hoping someone can critique my code or be inspired to create more Google Glass apps.
Falling in love with Xamarin
A couple of weeks ago, the state government agency Public Transport Victoria released the first version of their Timetable API. I knew I just had to make an app for Google Glass. Except one problem, I didn’t know Java or how to write Android apps.
Unlike my previous Google Glass apps using the Mirror API which allows web developers to develop apps in the form of Glass push notifications, this particular scenario required a native GDK app which could be initiated through voice and menu commands.
I tried a good effort to quickly get my head around Android development, but the tooling and documentation was simply sub-par compared to C# and .NET development. I’m sure the Glass Development Kit would be a piece of cake for any Android developer but learning Java, Android and the GDK all at once was just too much.
In an amazing coincidence, around the same time rumors of Microsoft acquiring Xamarin floated. I wasn’t entirely familiar with the Xamarin product at the time, but my eyes opened when I saw they supported developing for Google Glass using C# and Visual Studio piqued my interest.
Even as a C# noob, I could appreciate the straightforwardness of C#. (Objective-C makes me want to cry.)
Although I was skeptical of Xamarin Studio at first, I’m pleasantly surprised by the capabilities of the tooling. It was like Visual Studio Lite. Intellisense for the full Android SDK, multi-threaded breakpoints, variable explorers and integrated device deploys and debugging.
I have to admit the only weak aspect of developing with Xamarin is the documentation. Xamarin tries its best in its developer guides to provide an overview of the fundamentals in C#, but this is obviously no match to the official documentation in the native language. Surprisingly though StackOverflow was quite saturated with Xamarin questions and answers which helped with the small quirks here and there.
Unfortunately the current Xamarin licensing cost (upwards from $299 to $999 a year) would scare off most hobbyist developers. If the rumors of Microsoft’s acquisition are true, I certainly look forward to Microsoft opening up access for this amazing technology and tools to more developers via MSDN and the Visual Studio Express programs.
Microsoft already has the best developer tools on Windows. Now imagine if their tools were also the best in class for the competing but dominant mobile platforms.