That sample code is actually just a component which extends a VerticalLayout. To use this you then have to add this component to your Vaadin application. If you create a regular Vaadin application and add this sample code as a component to that, then you should be fine.
E.g. by providing a reference to an application along with the call to the utility class, I think you should get the context from that.
If you are trying to use this without a Vaadin application, then it’s not going to work. This since then you don’t have the context and the corresponding GWT widget which does that actual parsing from the browser: VBrowserDetails. Also the communication to the server side does not work. If you look at the source of VBrowserDetails, you might see how it works on the client side.