Can Mirror Api call an external web service?

萝らか妹 提交于 2019-12-11 09:25:01

问题


I want to develop an app with mirror api for the novel google glasses. Is it possible to call an external web service from the glassware? I have to use this web service to obtain the informations to display in the timeline cards.
If it is possible, how I can do it?


回答1:


You need to provide a web service that interacts with the user's timeline to insert cards, but you can interact with whatever other web services you want from within yours in order to get the data that you push. Something like this:

        insert timeline               get 3rd party
             cards                    data response
User's  <--------------  Your Mirror  <-------------  Third party
Glass   -------------->  web service  ------------->  web service
         subscribed                   make request
        notifications                 for 3rd party
         (menu items,                     data
          location)



回答2:


The simple answer is YES.

You'll probably want to develop your Glassware using the Google Mirror API as a server-based web application. (This doesn't require you to run any code on Glass, instead your application is written in PHP, Java, Python, .NET or one of the other languages supported by the Mirror API and resides on a web/cloud server.)

Your web-based application can then make any sorts of web-based API calls to other external web services or APIs, retrieve data or information and then format and send this information to your Google Glass device. How you consume these 3rd party web-services depends on your choice of programming language, but pretty much all of these languages have support for consuming external web service via XML, REST, JSON or SOAP.



来源:https://stackoverflow.com/questions/20563574/can-mirror-api-call-an-external-web-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!