app engine connected android tutorial - localhost:

2019-02-21 00:42发布

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..

1条回答
Evening l夕情丶
2楼-- · 2019-02-21 01:20

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.

查看更多
登录 后发表回答