Google has made a small change to the Google Calendar API that nonetheless could make a huge difference for developers and users. The Calendar API now supports push notifications - alerts sent directly to devices and apps instead of waiting for a client-side sync, a la Gmail - for updates that are practically instantaneous. The official app has had this for a while, but now third-party developers have access to this functionality, meaning that push notifications for subscribed Google Calendars can be sent to any app that supports the general Gcal API.
According to the Google Developers Blog, the change is surprisingly simple: here's an eight-line segment of code that illustrates how a subscribed calendar notifies an app, which then makes an API call to receive the update.
Map<String, String> params = new HashMap<String, String>(); params.put("server", "my-host.com"); Channel request = new Channel() .setId("unique_subscription_ID") .setType("web_hook") .setAddress(String.format("https://my-host.com/notification")) .setParams(params); service.events().watch("[email protected]", request).execute();
Developers will need to tweak their Google-compatible calendar or scheduling apps to take advantage of this, but once they do, background data usage, system resources, and battery life should be noticeably improved. Every day in every way, we get better and better. End users should start seeing apps on the Play Store updated soon. Devs, dive into the Google API v3 documentation if you want the more technical details.
Source: Google Developers Blog