【发布时间】:2013-05-19 13:40:07
【问题描述】:
我正在尝试按照 https://developers.google.com/eclipse/docs/endpoints-addentities 的示例教程进行操作,但我一直在搞清楚如何在 Eclipse 中生成 GameEndpoint.Builder 类。
按照此操作并按照描述生成云端点后,我创建了一个 GameEndpoint 类,但没有 GameEndpoint.Builder 类。所以很明显我有这个错误
GameEndpoint.Builder 无法解析为类型
在这一点上我很难过。如何在 Eclipse 中生成 GameEndpoint.Builder 类,或者什么会阻止它?
代码
public class NewGameTask extends AsyncTask<Context, Integer, Long> {
protected Long doInBackground(Context... contexts) {
GameEndpoint.Builder endpointBuilder = new GameEndpoint.Builder(
AndroidHttp.newCompatibleTransport(), new JacksonFactory(),
new HttpRequestInitializer() {
public void initialize(HttpRequest httpRequest) {
}
});
GameEndpoint endpoint = CloudEndpointUtils.updateBuilder(
endpointBuilder).build();
try {
Game game = new Game();
game.setStart(Calendar.getInstance());
Game result = endpoint.insertGame(game);
} catch (IOException e) {
e.printStackTrace();
}
return (long) 0;
}
}
【问题讨论】:
标签: android eclipse google-app-engine google-plugin-eclipse