所以我遵循了 GCM Demo 应用教程。http://developer.android.com/guide/google/gcm/demo.html
我让它与码头服务器一起工作。但现在我想为 java 服务器做应用程序引擎,但它不工作。我确信我的客户端配置正常,因为它适用于码头服务器。
在 ApiKeyInitializer.java 中,我用我的访问密钥替换了“replace_this_text_by_your_Simple_API_Access_key”。
我将 appengine sdk 复制到一个简单的位置 D:\appenginesdk 比我在 cmd 中运行:
ant -Dsdk.dir=D:\appenginesdk runserver -Dserver.host=192.168.0.101
其中 192.168.0.101 是我的本地 IP。
D:\gmcserverapp>ant -Dsdk.dir=D:\appenginesdk runserver -Dserver.host=192.168.0.101
Buildfile: D:\gmcserverapp\build.xml
init:
copyjars:
compile:
[javac] Compiling 1 source file to D:\gmcserverapp\WebContent\WEB-INF\classes
[javac]
[javac] WARNING
[javac]
[javac] The -source switch defaults to 1.7 in JDK 1.7.
[javac] If you specify -target 1.5 you now must also specify -source 1.5.
[javac] Ant will implicitly add -source 1.5 for you. Please change your build file.
[javac] warning: [options] bootstrap class path not set in conjunction with-source 1.5
[javac] 1 warning
datanucleusenhance:
[enhance] DataNucleus Enhancer (version 1.1.4) : Enhancement of classes
[enhance] DataNucleus Enhancer completed with success for 0 classes. Timings :input=156 ms, enhance=0 ms, total=156 ms. Consult the log for full details
[enhance] DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full details
runserver:
[java] aug 21, 2012 1:17:55 PM com.google.apphosting.utils.jetty.JettyLogger info
[java] INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
[java] aug 21, 2012 1:17:55 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
[java] INFO: Successfully processed D:\gmcserverapp\WebContent\WEB-INF/appengine-web.xml
[java] aug 21, 2012 1:17:55 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
[java] INFO: Successfully processed D:\gmcserverapp\WebContent\WEB-INF/web.xml
[java] aug 21, 2012 3:17:57 PM com.google.appengine.tools.development.DevAppServerImpl start
[java] INFO: The server is running at http://192.168.0.101:8080/
[java] aug 21, 2012 3:17:57 PM com.google.appengine.tools.development.DevAppServerImpl start
[java] INFO: The admin console is running at http://192.168.0.101:8080/_ah/admin
这就是我在模拟器中得到的
在浏览器中,我没有注册任何设备。
我能做些什么?
我究竟做错了什么?
我做了很多教程,没有任何效果,我变得绝望。
编辑 2012-08-21 15:57:
感谢 Yahor10,解决了一些错误。我现在收到此错误:
[java] aug 21, 2012 1:52:40 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet
[java] WARNING: No file found for: //register
编辑 2012-08-21 16:18:
// String serverUrl = SERVER_URL + "/register";
String serverUrl = SERVER_URL;
我为 Android 应用更改了 serverUtilities.java 中的 server_url。这使模拟器说它已连接。但是当我刷新 192.168.0.101:8080 它仍然没有设备......