简体   繁体   English

将android客户端与后端应用程序引擎模块连接

[英]Connect android client with backend app engine module

This question is because most of the information I find is obsolete and the google documentation I have found is not so clear for me. 这个问题是因为我发现的大多数信息已过时,而我发现的google文档对我来说却不太清楚。

Thing is I am developing an application with the backend in app engine and I am not sure how to pass the information between client and server, I have done the endpoints of my server logic and everything i find is not so clear. 我正在用后端在应用程序引擎中开发一个应用程序,我不确定如何在客户端和服务器之间传递信息,我已经完成了服务器逻辑的端点,发现的所有内容都不是很清楚。

I wish to make http querys with the info in Json, also I'm not sure how to use the async calls in the client even when I have the client library (from server endpoints) generated. 我希望使用Json中的信息进行http查询,即使我已经生成了客户端库(从服务器端点),我也不知道如何在客户端中使用异步调用。 I'm using Android Studio. 我正在使用Android Studio。

Please don't link obsoletes tutorials , most of the library or methods they use are deprecated and i'm not sure if is someone developing now for app engine or is better to build a server more traditional. 请不要链接过时的教程 ,它们使用的大多数库或方法都已过时,并且我不确定是否有人正在为应用程序引擎开发或更好地构建更传统的服务器。

Thank you all 谢谢你们

Actualization 现实化

Then I finally decided to follow this tutorial: 然后,我最终决定遵循本教程:

https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/HelloEndpoints https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/HelloEndpoints

Thing is It seems to be the solution but in my case It is not working. 事情似乎是解决方案,但就我而言,它不起作用。

To test in a real device in a LAN with the development server Do yo know if It is necessary some specific configuration else? 在带有开发服务器的LAN中的真实设备中进行测试知道是否还需要一些其他特定配置吗?

More than: 多于:

appengine {
  httpAddress = "0.0.0.0"
}

and

 .setRootUrl("http://<my-computer-address>:8080/_ah/api/")

I mean some kind of Auth or maybe the router blocks?? 我的意思是某种身份验证或路由器阻止?

Thanks 谢谢

actually, I don't understand clearly your question, but I guess you wanna connect your application to your backend ( API Webservice), right? 实际上,我不清楚您的问题,但我想您想将应用程序连接到后端(API Webservice),对吗? When I was a junior developer (Now, I am also a junior, but I have experience), I used HttpClient even thought it was deprecated. 当我是一名初级开发人员(现在,我也是一名初级人员,但是我有经验)时,我甚至认为HttpClient已被弃用。 Then I used OkHttpClient, it's ok and didn't have any problem but I think what senior program will do ? 然后我使用了OkHttpClient,没关系,没有任何问题,但是我认为高级程序可以做什么? Then my friends told me about Retrofit (library), to handle data you can use reactivex.rxjava . 然后我的朋友告诉我有关Retrofit(库)的信息,可以使用reactx.rxjava来处理数据。 You can try to explore base on my flow Reply if my opinion is wrong or have any confuse. 您可以尝试根据我的流程进行探索如果我的看法有误或有任何混淆,请回复。 Thanks 谢谢

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM