Google has published the Glass Mirror API Developer's Guide and Best Practices
Today, Google announced the beginning of deliveries of the first Google Glass and at the same time published a significant part of the documentation for developing applications for them.
The first is the developer guide for the Glass Mirror API. The access to the API itself is still in limited access and is open only to developers who have the device itself. The rest so far, as in the best of times, can start making applications based on documentation, but they cannot test them.
This first version of the API , which allows developers to write what Google calls Glassware, is relatively poor in functionality and the best feature is probably the ability to get the location of the owner of the glasses. Since each application interacts with Points via Google services, the API supports RESTful services and is completely cloudy - no code on the Points themselves is executed. ')
At its core, the API allows developers to send and receive information from a device. Using the API looks relatively simple, albeit limited. Users subscribe to a new application on the developer’s site (Google has released a number of proprietary icons for this).
The API gives developers the ability to communicate with the user through cards, which can include text, HTML code, images and video. These cards are similar to Google Now for Android cards and can be grouped into packages - and users can move between them - or be single.
The API can also add menu items to its applications. These can be system commands, such as “read out loud,” or your own commands created specifically for the application — you can call them from the menu or with your voice.
As for the interface, Google gave developers the ability to use HTML, and the Glass team provided the main CSS file . As Google writes, “creating your own template gives you the power to control the display of content, but responsibility also comes with force.”
Photos and videos (H.264) should have an aspect ratio of 16x9 and a resolution of 640x360 (this is the maximum resolution of Glass). Audio to AAC and MP3.
Best practics
Considering that Glass is a new concept, Google has also laid out some general recommendations on how applications should interact with Glasses, although it is not yet clear how the company will enforce them.
Developers, Google says, should remember that apps are created for points and always test their apps on the device before publishing. Applications should not obscure the user's view or annoy him with frequent and loud notifications. Applications also need to focus on real-time work and respond to user actions as quickly as possible. And given that the glasses are worn all day, developers should not surprise the user with "unexpected functionality."
In general, the first release greatly limits the possibilities of developers, but this is really the first release and it is likely that the functionality of the program interfaces will soon be expanded.
Below are a few videos in which Google explains some of the features of the Mirror API: