Skip to content

Latest commit

 

History

History
 
 

sync

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Calendar API Sync Samples

A set of samples that demonstrate how to utilize sync tokens and etags in the calendar API to sync resources more efficiently.

Introduction

To make it easier for your applications to stay in sync with your users' Google Calendar data the API has added support for sync tokens. These tokens store information about the data you've already retrieved, so that the next time you make a request you'll only be given the resources that have been added, updated, or deleted since your last sync. These samples demonstrate how to sync efficiently, utilizing sync tokens as well as resource versioning (etags).

Prerequisites

Read the following guides:

Setup your Java environment:

Getting Started

  1. Edit client_secrets.json and set the client ID and secret. You can create an ID/secret pair using the Google Developers Console.
  2. Run mvn compile to build the project.
  3. Run one of the three samples:
    • Sync Token Sample: mvn exec:java -Dexec.mainClass="com.google.api.services.samples.calendar.sync.SyncTokenSample"
    • Conditional Modification Sample: mvn exec:java -Dexec.mainClass="com.google.api.services.samples.calendar.sync.ConditionalModificationSample"
    • Conditional Retrieval Sample: mvn exec:java -Dexec.mainClass="com.google.api.services.samples.calendar.sync.ConditionalRetrievalSample"