谷歌应用程序引擎的Java和Android入门 [英] Google App Engine Java and Android Getting Started
问题描述
我一直在努力让运行例如,从如下:
I've been struggling to get the example running from below:
<一个href="https://developers.google.com/eclipse/docs/getting_started">https://developers.google.com/eclipse/docs/getting_started
第一个问题,我是没有安装在Android SDK的谷歌云消息传递为Android图书馆(很明显,我知道)。
The first problem I had was didn't have installed 'Google Cloud Messaging for Android Library' in the Android SDK (obvious I know).
但现在我有一个问题,自动生成的code在Android项目两个文件: GCMIntentService.java和RegisterActivity.java
But now I have an issue with the auto-generated code in two files in the Android project: GCMIntentService.java and RegisterActivity.java
的错误是:
- 的方法getDeviceInfo(字符串)是未定义的类型Deviceinfoendpoint GCMIntentService.java
- 的方法listMessages()是未定义的类型MessageEndpoint RegisterActivity.java
- 的方法insertDeviceInfo(DeviceInfo)是未定义的类型Deviceinfoendpoint GCMIntentService.java
- 的方法removeDeviceInfo(字符串)是未定义的类型Deviceinfoendpoint GCMIntentService.java
我使用的是Ubuntu上的Java SDK v1.7.0_15但我也尝试在Windows 7上使用Java SDK v1.6和有同样的问题。最新的Android 4.2.2平台和谷歌应用程序引擎1.7.7。 Eclipse是朱诺服务版本2。
I'm using Java SDK v1.7.0_15 on Ubuntu but I also tried on Windows 7 with Java SDK v1.6 and had the same issue. Latest Android Platform 4.2.2 and Google App Engine 1.7.7. Eclipse is Juno Service Release 2.
这个问题看起来他们正在做一些投错了,因为有一个方法getDeviceInfo的内部Deviceinfoendpoint(不同capatilisations)内部类DeviceInfoEndpoint。
The problem looks like they are doing some casting wrong, because there is a method getDeviceInfo for inner class DeviceInfoEndpoint inside Deviceinfoendpoint (different capatilisations).
我可以尝试修复它,但只是想知道如果我在我的设置这是发生什么事吗?
I could try and fix it, but just wondering if I have something wrong in my setup for this to be happening?
任何帮助将是AP preciated。
Any help would be appreciated.
推荐答案
在你GCMIntentService.java类,与错误的行端点对象之后,如下图所示添加.deviceInfoEndpoint():
In your GCMIntentService.java class, add .deviceInfoEndpoint() after the endpoint object in the lines with errors as shown below:
DeviceInfo existingInfo = endpoint.getDeviceInfo(registration)
DeviceInfo existingInfo = endpoint.deviceInfoEndpoint().getDeviceInfo(registration)
在RegisterActivity.java更改行
In RegisterActivity.java change the line
messageEndpoint.listMessages().setLimit(5).execute();
到
messageEndpoint.messageEndpoint().listMessages().setLimit(5).execute();
这篇关于谷歌应用程序引擎的Java和Android入门的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!