1

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

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

4

1 回答 1

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();
}

另请参阅https://developers.google.com/resources/api-libraries/documentation/mirror/v1/java/latest/上的 JavaDoc

于 2013-08-21T11:00:34.843 回答