-1

I am trying to use the Google Cloud Datastore for a simple read/write function in an Android app.

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.

I then went onto the Batch documentation here but the compiled gradle library lacks the Calender class used in this example code:

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

Thanks in advance

Cœur
  • 37,241
  • 25
  • 195
  • 267
Micah Simmons
  • 2,078
  • 2
  • 20
  • 38

1 Answers1

2

As explained in your linked page:

A complete example of batch using the Calendar API is available in the calendar-cmdline-sample.

The Calenadar API home page is at:

https://developers.google.com/api-client-library/java/apis/calendar/v3

There it is shown that the Gradle script requires:

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.google.apis:google-api-services-calendar:v3-rev191-1.22.0'
}
mjn
  • 36,362
  • 28
  • 176
  • 378
  • Thanks for your answer. I will look more into that example. I also found [this](http://googlecloudplatform.github.io/gcloud-java/0.2.3/index.html) library. – Micah Simmons Jun 11 '16 at 15:50