上的客户端应用程序谷歌云端点插入我跟谷歌的教程创建Android客户端发布简单的笔记来使用云终端的应用程序引擎的后端为在这里看到:从不灵本地服务器
https://developers.google.com/eclipse/docs/endpoints-create-fromandroid
我运行本地服务器,然后运行Android客户端应用程序,似乎都运行良好。没有错误报告。但是当我使用curl或API浏览器列出备注时,它将返回一个空集。
我一定要禁用我的病毒扫描程序并关闭我的防火墙。没有运气。我在手机上运行Android客户端(连接到我的无线网络),如果这有所作为。我永远无法让模拟器工作,它永远挂在引导屏幕上,所以我总是使用我的手机。
public class EndpointsTask extends AsyncTask<Context, Integer, Long> {
protected Long doInBackground(Context... contexts) {
Noteendpoint.Builder endpointBuilder = new Noteendpoint.Builder(
AndroidHttp.newCompatibleTransport(),
new JacksonFactory(),
new HttpRequestInitializer() {
public void initialize(HttpRequest httpRequest) { }
});
Noteendpoint endpoint = CloudEndpointUtils.updateBuilder(
endpointBuilder).build();
try {
Note note = new Note().setDescription("Note Description");
String noteID = new Date().toString();
note.setId(noteID);
note.setEmailAddress("E-Mail Address");
Log.e("Debug", "Inserting note...");
Note result = endpoint.insertNote(note).execute();
Log.e("Debug", "Done inserting note!");
} catch (IOException e) {
e.printStackTrace();
}
return (long) 0;
}
}
有趣的是,:按谷歌的指示
插入代码被执行为的AsyncTask“完成插入笔记!”从不打印。我将进一步的调试放入insertNote函数本身,并使它成为return语句的一切。不确定它不可能返回吗?
关于如何解决这个问题的任何建议?谢谢。
我该怎么做? – user1464652