google glass api 开发指南(google翻译附英文).docVIP

  • 12
  • 0
  • 约6.07万字
  • 约 48页
  • 2016-04-13 发布于浙江
  • 举报

google glass api 开发指南(google翻译附英文).doc

google glass api 开发指南(google翻译附英文)

开发指南 时间轴Timeline) 你的用户的时间轴被分为时间表项目。您可以使用API??接入和管理项目通过HTTP的REST操作时间表。Your users timeline is divided up into timeline items. You can use the API to insert and manage timeline items with REST operations over HTTP.) ??? 注意:时间轴的产品最后七天在用户的玻璃和30天镜象API。Note:?Timeline items last for seven days on a users Glass and 30 days in the Mirror API.) 插入一个简单的时间轴项目 阅读时间表项目 插入一个时间表与媒体项目 访问附件 捆绑卡 用户交互菜单项 使用内置的菜单项 定义自定义菜单项 允许用户固定时间表卡 插入一个简单的时间轴项目 要插入一个时间表项,POST一个?JSON表示的时间表项目的REST端点。 大多数字段都是可选的。最简单的形式,一个时间表项目只包含一个简短的文字消息。这是一个简单的时间表项目如何被插入。To?insert?a timeline item, POST a?JSON representation of a timeline item?to the REST endpoint. Most of the fields are optional. In simplest form, a timeline item contains only a short text message. This is how a simple timeline item is inserted. ) 原始HTTP的Java的 POST /mirror/v1/timeline HTTP/1.1 Host: Authorization: Bearer {auth token} Content-Type: application/json Content-Length: 26 { text: Hello world } Java的TimelineItem timelineItem = new TimelineItem(); timelineItem.setText(Hello world); service.timeline().insert(timelineItem).execute(); 在成功时,服务器会返回一个201响应代码创建创建项目的完整副本。对于上面的例子,可能看起来像一个成功的响应:On success, the server will return a 201 Created response code with a full copy of the created item. For the example above, a successful response might look like:) 原始的HTTP HTTP/1.1 201 Created Date: Tue, 25 Sep 2012 23:30:11 GMT Content-Type: application/json Content-Length: 303 { ?kind: glass#timelineItem, ?id: 1234567890, ?selfLink: /mirror/v1/timeline/1234567890, ?created: 2012-09-25T23:28:43.192Z, ?updated: 2012-09-25T23:28:43.192Z, ?etag: \G5BI0RWvj-0jWdBrdWrPZV7xPKw/t25selcGS3uDEVT6FB09hAG-QQ\, ?text: Hello world } 插入项目,将出现在用户的时间轴看起来像这样:The inserted item that would appear in the users timeline looks like this:) 阅读时间表项目Reading timeline items) 你的服务可以访问所有的时间表,它创建项目,以及所有共享项目时间表。以下是如何?为您服务是可见的项目列出时间表。Your service can access all timeline items that it created, and all timeline items that were shared with it. Heres how to?list?the timeline items that are visi

文档评论(0)

1亿VIP精品文档

相关文档