How to monitor a file on Google Drive and get notified when changes to this file have been made in an android application

StackOverflow https://stackoverflow.com/questions/18851010

Question

How can I monitor a file on Google Drive in the most efficient way in my android Application? I prefer not to use a polling mechanism because of the possible unneeded data traffic involved.

On the Google developers site I found the following information: https://developers.google.com/drive/v2/reference/files/watch But I cannot find any examples where this has been applied (e.g. how to use the channel, how to integrate this in a sync adapter etc.).

Was it helpful?

Solution

Watch notifications can only be received by web hooks at the moment, we're going to be extending the notifications to the mobile environments soon. For now, you need to poll files.get to see if there are any changes.

OTHER TIPS

With Google Play services 4.3 we can now register callbacks to be notified when a file changes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top