应用引擎连接android教程 - localhost:8888 / index未显示注册设备 [英] app engine connected android tutorial - localhost:8888/index not showing registered device

查看:472
本文介绍了应用引擎连接android教程 - localhost:8888 / index未显示注册设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在应用引擎连接的android应用上做了Google教程。当我注册模拟器设备时,应用引擎和android应用都工作正常。我看到屏幕显示注册成功,并且能够在localhost:8888 / admin / _ah页面上查看已注册的设备。但是,当我打开本地主机:8888 /索引文件发送消息时,页面显示搜索设备,而不是列出已注册的设备。你们有没有遇到类似的问题?任何帮助,将不胜感激..Thx ..

解决方案

我遇到了同样的问题。这是我在尝试解决问题之前所了解的。
- 转到您的项目-AppEngine - > war - > index.html



此html文件是当您转到localhost:8888时加载的内容。现在看看这个html文件的代码。在这里调用的JavaScript方法很少。注意两种方法

  //此方法加载deviceinfoendpoint和messageEndpoint库
函数loadGapi(){
gapi.client.load('deviceinfoendpoint','v1',function(){
updateRegisteredDeviceTable();
});

gapi.client.load('messageEndpoint','v1',function(){});
}

  function generateRegDeviceTable(deviceInfoItems)

这两个方法从数据存储获取注册设备并显示在html页面上的工作。
您可以使用这个html文件来调试原因。在我的情况下,原因是后端库没有注册。当我创建自己的实体并使用它们显示在index.html中时,它工作正常。当您安装GPE并启用后端引擎时,GCMEndpoint库会默认。因此,只需重做该过程并手动注册这些库,并且您的错误应该消失。

I did the google tutorial on the app engine connected android app . Both the app engine and the android app are working fine, when I register the emulator device. I get the screen saying registration succeeded and Im able to view the registered device on the localhost:8888/admin/_ah page. However when I open the localhost:8888/index file to send a message, the page says "searching for devices" instead of listing the registered device. Have any of you encountered a similar problem? Any help would be appreciated..Thx..

解决方案

I came across the same problem. here is what I understood before trying to resolve the issue. - go to yourproject-AppEngine-->war-->index.html

This html file is what is loaded when you go to localhost:8888. Now look inside the code of this html file. There are few javascript methods being called here. Look out for two methods

 // This method loads the deviceinfoendpoint and messageEndpoint libraries
 function loadGapi() {
 gapi.client.load('deviceinfoendpoint', 'v1', function() {
   updateRegisteredDeviceTable();
 });

 gapi.client.load('messageEndpoint', 'v1', function() {});
 }

and

function generateRegDeviceTable(deviceInfoItems)

These the two methods which do the job of getting the registered devices from datastore and display on html page. You can play around with this html file to debug the reason. In my case the reason was the backend libraries were not registered. When I am creating my own entities and using them to be displayed in the index.html then it works fine. the GCMEndpoint libraries come default when you install GPE and enabled the backend engine. Hence just redo the process and manually register the libraries and your error should be gone.

这篇关于应用引擎连接android教程 - localhost:8888 / index未显示注册设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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