Gadgets, Programming, Python

Creating the Guardian’s Glassware

For the last two months on and off I’ve been developing the Guardian’s Glassware in conjunction with my colleague Lindsey Dew.

Dealing with secret-pre-alpha hardware has at times being interesting but the actual process of writing services using the Mirror API is actually pretty straight-forward.

Glass applications are divided into native, using the Glass SDK, and service-based Glassware using Mirror. Mirror is built on web-friendly technologies such as HTTP, JSON and OAuth2. It also follows the Google patterns for APIs so things like authentication, discovery and the client libraries are all as you would expect if you’ve used a modern Google API before.

For our project, which was focussed on trying to create a sensible, useful newsfeed to Glass, we went with Mirror. If you want to do things like geolocation or picture and video upload then you’ll want to go native.

For various reasons we had a very narrow initial window for development. Essentially we had to start and finish in May. Our prototyping was done with a sample app from Google (you can use Mirror without an actual device), the Mirror playground and a lot of imagination.

When we actually got our Glass devices it took about a week to get my head round what the usecase was. I was thinking that it was like a very lightweight mobile phone but it is much more pervasive with lots of light contact points. I realised that we could be more aggressive about pushing information out and could go for larger sets of stories (although that was dialled back a bit in the final app to emphasise editorial curated content).

Given the tight, fixed deadline for an unknown product the rest of the application was build using lots of known elements. We used a lot of the standard Glass card templates. We used Python on Google App Engine to simplify the integration service and because we had been building a number of apps on that same stack. The application has a few concerns:

  • performing Google Authentication flow
  • polling the Guardian’s Content API and our internal Notification platform
  • writing content to Mirror
  • handling webhook callbacks from Mirror
  • storing a user’s saved stories

We use Content API all the time and normally we are rendering it into widgets or pages but here we are just transforming JSON into JSON.

The cards are actually rendered by our application and the rendered content is packaged into the JSON along with a text representation. However rendering according to the public Glass stylesheet and the actual device differed, and therefore checking the actual output was important.

The webhooks are probably best handled using deferred tasks so that you are handing off the processing quickly and limiting the concern to just processing the webhook’s payload.

For the most part the application is a mix of Google stock API code and some cron tasks that reads a web API and writes to one.

Keeping the core simple meant it was possible to iterate on things like the content mix and user interactions. The need to verify everything in device served as a limiting factor.

Glass is a super divisive technology, people are very agitated when they see you wearing it. No-one seems to have an indifferent opinion about them.

Google have done a number of really interesting things with Glass that are worth considering from a technology point of view even if you feel concerned about privacy and privilege.

Firstly the miniaturisation is amazing. The Glass hardware is about the size of a highlighter and packs a camera, memory, voice synth, wifi and bluetooth. The screen is amazingly vivid and records and plays video well. It has a web browser that seems really capable of standard HTML rendering.

The vocal recognition and command menus are really interesting and you feel a little bit space age when you fire off a Google query and get the information you’re looking for read back to you in seconds.

Developing with the Mirror API is really interesting because it solves the Android fragmentation issue. My application talks to Mirror, not to the native device. If Google want to change the firmware, wire protocol or security they can without worrying about how it will affect the apps. If they do have to make breaking changes then can use the standard webapi versioning they already use.

Unlike most of the Guardian projects this one has been embargoed before the UK launch but it is great to see it out in the open. Glass might not be the ultimate wearable tech answer; just as the brick phones didn’t directly point to the iPhone. Glass is a bold device and making the Guardian’s journalism available on a new platform has been an interesting test of our development processes and an interesting challenge to the idea of what web-capable devices are (just as the Pixel exposed some flaky thinking about what a touch device is).

What will be interesting from here is how journalists will use Glass. Our project didn’t touch on how you can use Glass to share content from the scene, but the Glass has powerful capabilities to capture pictures and video hands-free and deliver it back to desk editors. There’s already a few trials planned in less stressful feature pieces and it will be interesting to see if people find the interface intuitive and more convenient that firing up their phone.

Standard
Gadgets

The Doxie handheld scanner

Doxie makes handheld scanners, which seemed the perfect replacement for my flatbed scanner that is currently without working drivers for any modern OS.

I opted for the DoxieOne even though my scanning is primarily for Linux and there it wasn’t going to use all the integration and software the device comes with.

Doxie’s failure to integrate with Linux is a bit baffling but the basic behaviour is absolutely acceptable. It connects as a standard storage device by USB and you can just use all your usual tools against the device’s drive.

The scans produced are good quality and unlike a flatbed it will scan any length of document as long as it is roughly A4 or less in width. Of course you can’t use it to scan books (although there is a mini-flatbed version) if that matters to you.

The only real difficulty in using the Doxie is that an slight misalignment when you first engage the roller can get very pronounced by the end of the scan and the result is a picture at an angle that is hard to fix up in an image editor. If I realise that something is feeding incorrectly I tend to rescan as it is easier.

I was looking for a portable scanner that is easy to store and interact with and the Doxie meets the bill in an elegant way.

Standard
Gadgets

Wifi extension using Solwise power adaptors

I have a problem in my building of having many competing wifi networks, having tried upgrading my router and also scanning the networks to try and find the least used channels I decided that the only way to improve things was to try a wifi extender. My initial plan was to try a range extender but figuring that my problem was congested airspace I thought I might give powerline transmission a go instead since at least my electrical cabling ought to be mine alone.

I’ve been kind of aware of powerline transmission from former colleagues and the tech publications but I have to say that I don’t know how it works and it feels kind of magical right now. After looking at some recommendations on Amazon and BE forums I selected a package by Solwise and bought it direct from them but via Amazon Marketplace for convenience.

Setup wasn’t complicated but wasn’t exactly plug and play either. Contrary to what I had read it was perfectly possible to use the adaptors in gang plugs which was helpful in getting the pairing and initial connectivity to work. There is a helpful leaflet in the package that shows you how to pair the adaptors but I seemed to be struggling to get the individuals into pairing mode rather than resetting. In the end I think I put the extender into pairing mode first and then the adaptor that was going to connect to the router.

Once they were paired then getting access going was as simple as connecting a ethernet cable to the router. LEDs indicate whether the connection is being shared or not but I would recommend connecting to the default unprotected wifi network first to make sure everything is working.

Setting up the SSID and password was again a little more involved than I expected, there was another leaflet that explains the whole process and the easiest way to do the setup is by connecting a laptop directly via Ethernet cable. However at one stage I was modifying my laptop’s IP address to get it to connect to the in-built webserver which is fine for me but I wouldn’t want to be explaining that process over the phone on parent support.

With the setup up done then the whole thing works really well, the adaptors give a great signal and fast connections, transforming my previously flaky connections for the PS3 and AppleTV. The extending adaptor runs too hot for my liking but you can just choose to unplug it. A pretty cheap solution to my problem.

Standard
Gadgets

A Kindle and not an iPad?

I had been waiting for the Apple Tablet for a long time. Although I had been mulling the Sony E-Reader for a while there was no way I was going to buy anything until I saw what was behind all the rumours.

Then came the big iPhone… well it may be a sound consumer electronic device but it wasn’t what I was looking for. Namely I wanted to read books and ideally I wanted to recharge less than once a week.

But in the end I didn’t go back to the Sony, instead I ordered a Kindle from across the pond, complete with US power adaptor. So what was I thinking?

Well firstly I know the Kindle is DRM and platform-lock-in bad. Strangely the iPad being based on the iPhone OS and being locked down made this an easier choice. Sony devices are no less proprietary if they are actually the market leader.

In these terms I think consumers actually need to put pressure on both Apple and Amazon to play fair with them. After all Amazon opened up the music market from Apple’s iTunes DRM, hopefully with the advent of the iPad Amazon may have to consider opening up the Kindle to ePub books.

In the end the thing that really convinced me about the Kindle was actually the Kindle for PC software. Being able to download the software and play around with the Amazon ordering system really helped, in fact if they already had a Kindle of OSX I may not have even ordered the physical device because the software actually delivered a reading experience I enjoyed.

Friends had complained about the poor experience of buying books for the Sony reader and as a heavy Amazon consumer already I am already in tune with the Amazon experience and have the necessary accounts.

Since getting the Kindle I have been impressed with the idea of having the books licensed (unfortunately) to an account that is then synchronised between all the Kindles you’re reading. I like being able to read a few pages on the PC and then carry on where I left off on the tube. That’s a nice feature that is a bit unique at the moment (although I am open to the idea of having multiple sets of ebook software).

I bought the smaller Kindle (not the DX) as frankly the iPad’s full colour and touch screen mean that I didn’t fancy paying the same amount for something that is much more limited. It does mean that PDFs don’t have enough screen space and the lack of a zoom is frustrating. However a big plus is the free wireless, paying a subscription for the iPad was unappealing and the ability to go and look things up in Wikipedia from the Kindle is not getting old yet.

Standard
Macbook

The Macbook has arrived!

At last I have the power to surf the web from my bed! The MacBook has arrived! It flew all the way from China with me watching all the way, via the TNT website, like some obsessive voyeur. First impressions are that it is small, sexy, with a great keyboard. The negative impressions are that the thing runs hot (was there any point in getting the lower MHz), is slightly heavier than expected and eats battery time.

It is also turning my world upside down as I am now forced to leave my Windows comfort zone and look at a new way of doing things. Suddenly the issue of cross-platform software is very pressing. Web applications (such as WordPress) seem more valuable than ever.

Overall though it is just what I wanted: a small powerful machine that is quick to launch and allows me to act on any idea I may have. The only negative right now is heat. Apparantly Apple have stopped calling the MacBook a laptop in favour of the term “notebook”. Good call, “lap griddle” would probably be a more accurate term.

Standard
Java

Toothbrush 3000

Our electric toothbrush’s casing cracked this weekend. Since mixing water and electric tools seemed a bad idea the search was on for a replacement. Since heads are expensive and we had quite a few of our current model stocked up we were essentially going to get pretty much the same model we have now. However turning up at Sainsbury’s revealed that there are now at least three models in the range. In addition one of the models is also produced in pink.

That lead to an unexpected need to make a choice. Having established the equivalent model to the one we already had left us with a choice, the equivalent (now branded the 5000) and the next model up the 7000. The price difference was about £15 but the actual difference between the two models was very unclear and there was a lot of head scratching and reading over the back of packets.

About the only definite difference was that the battery life for the 7000 is meant to be greater (and our current one is a bit crap, swiftly draining juice if not permenantly attached to the shaver socket) so what the hell, we bought a 7000.

The first experience was positive, there is at least a difference between the brushing motion of the old toothbrush and this one but is there a 2000 level difference? It is going to take longer than 24 hours to judge that.

Standard