Glass Mirror API服务 - 如何获取镜像服务器对象?

时间:2013-08-21 06:05:22

标签: google-mirror-api google-glass

我们如何在java示例中引用服务对象?

https://developers.google.com/glass/v1/reference/timeline/attachments/list

1 个答案:

答案 0 :(得分:2)

https://github.com/googleglass/mirror-quickstart-java(特别是https://github.com/googleglass/mirror-quickstart-java/blob/master/src/main/java/com/google/glassware/MirrorClient.java)的快速入门示例代码中,您可以使用

等代码通过构建器获取Mirror对象
public static Mirror getMirror(Credential credential) {
  return new Mirror.Builder(new NetHttpTransport(), new JacksonFactory(), credential)
      .setApplicationName("PG Java Starter").build();
}

另见JavaDoc at https://developers.google.com/resources/api-libraries/documentation/mirror/v1/java/latest/