如何使用Android的终端与App Engine搜索API [英] How to use endpoints for Android with App Engine Search API

查看:243
本文介绍了如何使用Android的终端与App Engine搜索API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将需要(从10万到1000万不等)经度/纬度(GEO)点储存大量附加一些额外的变量。当用户登录到我的Andr​​oid应用程序,将请求公里半径范围内的所有geopoints。

我已经阅读博客,文件和计算器上的问题和得出的结论,最好的比赛将组合使用谷歌应用程序引擎的应用程序引擎的搜索API,并连接到我的Andr​​oid应用程序的端点。

最近,我跟着<一个href=\"https://cloud.google.com/developers/articles/how-to-build-mobile-app-with-app-engine-backend-tutorial\"相对=nofollow>本教程并成功地有我的Andr​​oid应用程序从App Engine数据存储中获取数据,因此终端侧我得到了覆盖(或多或少)。

我有以下问题:


  1. 是否应用程序引擎的结合,搜索API和端点有意义吗?

  2. 通过上面的教程中,我的应用程序从数据存储检索的数据。它实际上应该从搜索API检索。这可能与我目前的端点的设置吗? 本教程演示如何创建,添加和检索(搜索)文档内的指数。可以在教程的code插入我的终点AppEngine上的一面?

  3. 有没有什么好的教程,我已经就这个错过了(除了上面连接的两个),用于我的目标或者甚至可能更好,上述设定的任何开源的例子吗?

重要修改:我写的App Engine的Java中

由于提前,

(我是新来的App Engine,端点和搜索API,试图找到我的方式,学习快)。


解决方案

  1. 的结合有一定道理。 App Engine的一个平台是如此强大,正是因为你,而不是简单地定义一个API servlet和自己的协议(或实施jsonrpc2.0获得这么多的API和服务,如搜索API和增强您的工作流程,如端点系统,例如)

  2. 是的,你可以使用一个端点API函数来运行任何类型的$ C $的c您可以在您的应用程序运行的其他地方。你可以有你的终点getNearbyPoints(GeoPoint对象p)的函数运行一个搜索API查询并返回结果。为了一切联系在一起这一点,我建议你保存完整的数据(你提到有大量的元数据),用于数据存储的一个点作为一个实体,但搜索API在相应的文件,在,只存储数据存储这个实体的ID,让你的终端API函数code可以使用搜索API由点p距离进行查询,然后将其转换结果充分对象送回去。

  3. 您可以看看这些额外的资源。不知道你是否读过任何或所有这些,但它们包含有价值的信息反正。

I will need to store a lot (anywhere from 100k to 10 million) longitude/latitude (geo)points with some extra variables attached. When the user logs in to my Android application it will request all geopoints within a kilometer radius.

I've read blogs, documentation and questions on stackoverflow and came to the conclusion that the best match would be using Google App Engine in combination with the App Engine Search API and make endpoints connected to my Android Application.

I recently followed this tutorial and succesfully had my Android Application get data from App Engine Datastore, so the endpoint side I got (more or less) covered.

I have the following questions:

  1. Does the combination of App Engine, Search API and endpoints make sense?
  2. With the tutorial above, my app retrieved data from Datastore. It should actually retrieve from Search API. Is this possible with my current setup of endpoints? This tutorial shows how to create, add and retrieve(search) documents inside an index. Can the code of that tutorial be inserted into Appengine side of my endpoints?
  3. Is there any good tutorial that I've missed concerning this (besides the two linked above) for my goal or possibly even better, any opensource example of the above described setup?

Important edit: I am writing the App Engine in Java.

Thanks in advance,

(I am new to App Engine, Endpoints and Search API, trying to find my way and learning fast).

解决方案

  1. The combination does make sense. App Engine as a platform is so powerful exactly because you have access to so many APIs and services like search API and enhancements to your workflow like the Endpoints system, instead of simply defining an API servlet and your own protocol (or implementing jsonrpc2.0, for example)
  2. Yes, you can use an endpoint API function to run any kind of code you could run anywhere else in your app. You could have your endpoint getNearbyPoints (GeoPoint p) function run a search API query and return the results. In order to link this all together, I'd recommend storing the full data (you mentioned there is lots of metadata) for a point in Datastore as an entity, but in the corresponding "document" in the search API, storing only the Datastore ID of this entity, so that your endpoints API function code can use the search API to query by distance from point p, then convert the results into full objects to send back.
  3. You could take a look at these additional resources. Not sure if you've read any or all of them, but they contain valuable info anyways.

这篇关于如何使用Android的终端与App Engine搜索API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆