【发布时间】:2016-10-12 10:16:52
【问题描述】:
我正在尝试将 Google Cloud Datastore 用于 Android 应用中的简单读/写功能。
我转到this 页面并编译了这个“compile 'com.google.apis:google-api-services-datastore:v1beta2-rev31-1.22.0'”gradle 依赖项以及 MavenCentral 存储库。
然后我进入批处理文档here,但编译后的 gradle 库缺少此示例代码中使用的 Calender 类:
JsonBatchCallback<Calendar> callback = new JsonBatchCallback<Calendar>() {
public void onSuccess(Calendar calendar, HttpHeaders responseHeaders) {
printCalendar(calendar);
addedCalendarsUsingBatch.add(calendar);
}
public void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) {
System.out.println("Error Message: " + e.getMessage());
}
};
...
Calendar client = Calendar.builder(transport, jsonFactory, credential)
.setApplicationName("BatchExample/1.0").build();
BatchRequest batch = client.batch();
Calendar entry1 = new Calendar().setSummary("Calendar for Testing 1");
client.calendars().insert(entry1).queue(batch, callback);
Calendar entry2 = new Calendar().setSummary("Calendar for Testing 2");
client.calendars().insert(entry2).queue(batch, callback);
batch.execute();
我需要编译哪些其他依赖项才能获得该类?
我用谷歌搜索并查看了其他 stackoverflow 问题 here 和示例项目 here,我似乎找不到如何使用 Google Datastore 进行 CRUD 操作的简单演示。有人可以向我指出一些综合文档/教程的方向,该教程解释了如何在不使用 Google App Engine 的情况下在 Google Datastore 上执行 CRUD 操作?
提前致谢
【问题讨论】:
-
为什么这个问题被否决了?
-
要求我们推荐或查找书籍、工具、软件库、教程或其他非现场资源的问题对于 Stack Overflow 来说是题外话,因为它们往往会吸引固执己见答案和垃圾邮件。
-
感谢您的解释,非常感谢
标签: java android crud google-api-java-client google-cloud-datastore