3

你能指导我如何做到这一点。我必须使用位置更改,并且必须根据该位置发送一些信息。

4

2 回答 2

4

请参阅https://developers.google.com/glass/locationhttps://developers.google.com/glass/v1/reference/locations,了解有关使用 Google Glass 位置信息的完整信息。

请记住,您需要请求附加范围https://www.googleapis.com/auth/glass.location才能获取任何位置信息。

完成此操作后,Glass 会将最近已知的位置(通常是过去 10 分钟内您去过的地方)附加到报告给您的任何时间线项目。

您可以随时获取可用位置更新列表,或 Glass 提供的“最新”位置。此外,您可以订阅“位置”集合(请参阅https://developers.google.com/glass/v1/reference/subscriptions),您将大约每 10 分钟收到一次位置更改通知,其中包括一个用于获取关联位置。

于 2013-10-03T15:19:40.680 回答
0

当用户订阅我们的 Glassware 应用程序时,我们可以插入位置更改订阅。之后,镜像 API 将通知给定 url 的位置更改。

像这样

            //create a Subscription for location changes
            Subscription subscriptionLocation = new Subscription()
            {
                Collection = "locations",
                UserToken = userId,
                CallbackUrl = Url.Action("Notify", "Notify", null, Request.Url.Scheme)
            };
            //insert a Subscription
            mirrorService.Subscriptions.Insert(subscriptionLocation).Fetch();
于 2013-10-07T06:19:42.703 回答