The Google
Mirror API allows you to build services that interact with Google Glass.
It provides this functionality over a cloud-based API and does not require running code on Glass.
simply fork or download the project, you can also download the binary itself and link it
to your project, or import to your IDE of choice such as Flash Builder 4.7
.
- supports all of the methods of
RESTful
API. - an exact one-to-one API as the official
JAVA
andC#
client. - all of the results are returned in corresponding typed data.
- uses
Hendrix HttP library
.
- I recommend the following official Google Mirror api reference.
- you will need to create a google app in the Google App Engine and activate Mirror API, and grab
Client ID
andSecret
. - then, you will need to download an
OAuth 2
token library forAS3
. there are many at GitGub. I used actionscript-oauth2. - simply create valid OAuth 2 tokens using the
Client ID
andSecret
and a library you have chosen from step 3.
private var _mirror: Mirror = null;
private function init():void {
_mirror = new Mirror();
_mirror.oauthToken = "ya29.7gBhg5ObSvi68Ncki43yAR23KnZahPQQ-A-D1VFbfPCPoFGGY59wdBBfBE0KK9T_8XYZ5lk9REZ9Kg";
}
protected function timeline_insert(dataImg: ByteArray):void
{
var item:TimelineItem = new TimelineItem();
item.text = "hi";
_mirror.timeline.insert(item, dataImg).execute(req_onComplete, req_onError);
}
private function req_onComplete(res:TimelineItem = null):void
{
trace(res.id);
}
private function req_onError(res:Object = null):void
{
trace("error");
}
- completely free source code. Apache License, Version 2.0.
- if you like it -> star or share it with others