[英]Using 'Google Cloud Datastore API Client Library for Java' with Gradle
I am trying to use the Google Cloud Datastore for a simple read/write function in an Android app. 我正在尝试将Google Cloud Datastore用于Android应用程序中的简单读取/写入功能。
I went on to this page and compiled this " compile 'com.google.apis:google-api-services-datastore:v1beta2-rev31-1.22.0'
" gradle dependency along with the MavenCentral repository. 我转到此页面并编译了这个“
compile 'com.google.apis:google-api-services-datastore:v1beta2-rev31-1.22.0'
” gradle依赖项以及MavenCentral存储库。
I then went onto the Batch documentation here but the compiled gradle library lacks the Calender class used in this example code: 然后,我在这里查看了批处理文档,但是编译的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();
What other dependencies do I need to compile to get that class? 为了获得该类,我还需要编译其他哪些依赖项?
I have googled around and looked over other stackoverflow questions here and the sample projects here and I can't seem to find a simple demo of how to do CRUD operations with Google Datastore. 我用Google搜索周围,看着其他计算器问题, 在这里和样本项目在这里和我似乎无法找到如何做CRUD操作与谷歌数据存储一个简单的演示。 Can someone please point me in the direction of some comprehensive documentation/ a tutorial that explains how to perform CRUD operations on Google Datastore without using Google App Engine?
有人可以指出一些综合性文档/教程的方向,该教程解释了如何在不使用Google App Engine的情况下对Google Datastore执行CRUD操作吗?
Thanks in advance 提前致谢
As explained in your linked page: 如您的链接页面中所述:
A complete example of batch using the Calendar API is available in the calendar-cmdline-sample.
calendar-cmdline-sample中提供了使用Calendar API的批处理的完整示例。
The Calenadar API home page is at: Calenadar API主页位于:
https://developers.google.com/api-client-library/java/apis/calendar/v3 https://developers.google.com/api-client-library/java/apis/calendar/v3
There it is shown that the Gradle script requires: 那里显示了Gradle脚本需要:
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.apis:google-api-services-calendar:v3-rev191-1.22.0'
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.