简体   繁体   English

如何使用带有云端点的Google App Engine从Android设备上的数据存储中检索数据?

[英]How to retrieve data from the datastore on Android device, using Google App Engine with Cloud Endpoints?

I am building an Android Application using Google App Engine with Cloud Endpoints. 我正在使用带有云端点的Google App Engine构建Android应用程序。 I carefully followed this tutorial ( https://developers.google.com/eclipse/docs/endpoints-addentities ), thus I managed to successfully perform insert operation in the datastore. 我仔细地遵循了本教程( https://developers.google.com/eclipse/docs/endpoints-addentities ),因此我成功地在数据存储区中执行了插入操作。 Furthermore, because I am facing the fuzziness of the beginner with respect to everything, I received a really good advice(that helped me to organize the information in my head, and then my code) in the following manner(I have inserted also the explanations): 此外,因为我面对初学者关于一切的模糊性,我收到了一个非常好的建议(这帮助我按照以下方式组织了我的头脑中的信息,然后我的代码)(我已经插入了解释):

  1. JPA entity (POJO with getters and setters and JPA annotations only) => I have this, is a class called Note (I have the corresponding setters and getters) (it's stored in the myapp-AppEngine (server side). JPA实体(POJO只有getter和setter以及JPA注释)=>我有这个,是一个名为Note的类(我有相应的setter和getters)(它存储在myapp-AppEngine(服务器端))。

  2. Data access layer: This is a class with methods to perform queries on your JPA POJO (using EntityManagerFactory). 数据访问层:这是一个具有在JPA POJO上执行查询的方法的类(使用EntityManagerFactory)。 => I assume it's the automatically generated class after I did Note >> Google >> Generate Cloud Endpoint Class. =>我认为这是我做过注释>> Google >> Generate Cloud Endpoint Class后自动生成的类。 The obtained class is one the has Create,Read,Update,Delete operations. 获得的类是具有创建,读取,更新,删除操作的类。 (I assume this one is the data acces layer ? - correct me if I am wrong, please). (我假设这个是数据访问层? - 请纠正我,如果我错了,请)。

  3. Business layer: This is a class where I should manipulate the data I receive, then pass the result to the data access layer. 业务层:这是一个我应该操纵我收到的数据的类,然后将结果传递给数据访问层。 => This is where it's a little bit unclear, because I am not sure how I should proceed. =>这是有点不清楚的地方,因为我不确定我该怎么办。 I should consider Business Layer as an intermediate class, where I manipulate the data, so that I do not access the methods from the Data Access layer directly from the Client-side (Android-side) of my application? 我应该将Business Layer视为一个中间类,我操作数据,以便我不直接从我的应用程序的客户端(Android端)访问数据访问层中的方法?

Or, is there any other way I could retrieve data from my datastore? 或者,还有其他方法可以从我的数据存储中检索数据吗? Even if, I consider really useful this way of organizing my code, clear, and somehow natural. 即使,我认为这种组织代码的方式非常有用,清晰,并且有些自然。 If anyone could indicate me how I can do this, I'd really appreciate it. 如果有人能告诉我如何做到这一点,我真的很感激。

Thank you. 谢谢。

@Cropcircles , you can refer the following docs and sample code provided by google : @Cropcircles,您可以参考以下docs和google提供的示例代码:

1, Sample code for design of app engine backend in java using google cloud endpoints 1,使用谷歌云端点设计java引擎后端的示例代码

2, Guidelines and sample code for consuming the endpoints, that is accessing data from datastore, in an android client 2,在Android客户端中使用端点(即从数据存储区访问数据)的准则示例代码

3, You can find the guidelines also for consuming endpoints in IOS and JavaScript clients. 3,您还可以在IOSJavaScript客户端中找到用于使用端点的准则。 Samplecode for IOS IOS的示例代码

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过Google Cloud Endpoints将两个Android应用连接到同一App Engine数据存储区? - How to connect two Android apps through to the same App Engine Datastore through Google Cloud Endpoints? 如何使用谷歌应用程序引擎从数据存储区检索信息,并使用Java在Android应用程序的列表视图中显示它? - how to retrieve info from datastore using google app engine and display it in a list view on an android app using java? 使用Google Cloud Endpoints的Android应用:数据存储区与SQL - Android app using Google cloud Endpoints: Datastore vs SQL 如何从Android中的Google App Engine数据存储区中获取数据 - how to fetch data from google app engine datastore in android Android客户端-使用Google Cloud Endpoints的Google App引擎身份验证 - Android Client - Google App engine authentication using Google Cloud Endpoints 使用适用于Google App Engine的Cloud Endpoints对Android App进行本地测试 - Local testing for Android App using Cloud Endpoints for Google App Engine 如何将敏感数据从Android应用传递到Google Cloud Endpoints? - How to pass sensitive data to Google Cloud Endpoints from Android app? 如何在没有App Engine的情况下在Android中获取Google Cloud Datastore实体? - How to get a Google Cloud Datastore entity in Android without App Engine? 如何从Android应用程序和django网站访问一个Cloud Datastore(Google App Engine)? - How to access one Cloud Datastore(Google App Engine) from Android app and django-website? App Engine如何使用Google Cloud Endpoints执行缓存 - How app engine perform caching using google cloud endpoints
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM