使用云端点谷歌App Engine的本地测试Android应用 [英] Local testing for Android App using Cloud Endpoints for Google App Engine

查看:230
本文介绍了使用云端点谷歌App Engine的本地测试Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序,使用谷歌云端点上的谷歌应用程序引擎(在Python)为其后端。使用谷歌播放服务的Andr​​oid设备上的Andr​​oid应用程序授权用户,而这一切的作品充满了想象。

I am developing an Android app that uses Google Cloud Endpoints on Google App Engine (in Python) for its backend. The Android app authorizes the user using Google Play Services on the Android device, and it all works fantastically.

不过,现在我有实际的用户,我希望能够部署任何应用程序引擎API的变化到生产前测试所有这些地方,我也没有想出如何让Android应用程序跟我的本地开发服务器的任何地方。该测试建议表明,我只是做一些手工摆弄API浏览器,但我使用端点原始数据存储我的API,这使得Android开发容易,这也使得API浏览器基本没用,因为我需要打的电话都远远超过了我可以手动生成更复杂。

However, now that I have actual users, I'd like to be able to test this all locally before deploying any app engine API changes to production, and I haven't figured out how to have the Android app talk to my local development server anywhere. The testing recommendations suggest that I just do some manual tinkering with API Explorer, but as I'm using the Endpoints Proto Datastore for my API, which makes the Android development easy, it also makes the API Explorer basically useless, since the calls I need to make are far more complicated than what I can generate by hand.

一个答案这个问题表明,有一种方法可以指向了Android客户端在本地服务器上,但同时我可以使用--host参数有什么localhost以外的dev_appserver的默认服务器听着,我似乎无法找到一个方法来为API服务器做同样的。即使我能做到这一点,它可能只是第一步,一个完整的终端到终端的本地测试设置为我的Andr​​oid应用程序。

One answer to this question suggests that there is a way to point the Android client at the local server, but while I can use the --host argument to have the dev_appserver's default server listen on something other than localhost, I can't seem to find a way to do the same for the API server. And even if I could do that, it might only be the first step to a full end-to-end local testing setup for my Android app.

有人可以张贴在如何我可以这样做,或短的,请赐教上的最佳实践,用于测试使用的应用程序引擎谷歌云端点Android应用程序的详细信息?感谢您事先的任何答案。

Can someone post more details on how I might do this, or short of that, please enlighten me on the best practices for testing Android apps that use Google Cloud Endpoints on App Engine? Thanks in advance for any answers.

推荐答案

在当地的环境中,dev_appserver是API服务器。如果你已经配置它,以便它是从机localhost以外的访问(即网络上的另一台机器/设备)的API请求应便于为好。

In the local environment, the dev_appserver is the API server. If you've configured it so that it's accessible from machines other than localhost (i.e. another machine/device on the network) API requests should be accessible as well.

不过,目前旗下有一个问题与本地服务器和gzip压缩请求。在此之前的固定式,你需要禁用你的Andr​​oid应用客户端库中使用gzip压缩(见本<一href="http://stackoverflow.com/questions/15393363/how-to-disable-gzipcontent-in-cloud-endpoints-builder-in-android">post).

However, there's currently an issue with the local server and gzipped requests. Until that's fixed you'll need to disable gzipping within the client library in your Android app (see this post).

这篇关于使用云端点谷歌App Engine的本地测试Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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