I am trying to create an Android application that uses a Google drive to store a file. Now I want to detect changes in one file by any device. To detect a change in the file, try to get the modified file time using the code below (using the new google drive api for android) https://developers.google.com/drive/android/get-started
DriveFile file = Drive.DriveApi.getFile(mGoogleApiClient, fileId);
Metadata fmd = file.getMetadata(mGoogleApiClient).await().getMetadata();
Log.e("modified date",""+fmd.getModifiedDate());
but his time indicating the time is not always wrong. it does not return the modified time when another device (using the same application) modifies the same file. is there any other way to detect changes in the file ??? thanks
I also use the code below, but no luck
DriveFile file = Drive.DriveApi.getFile(mGoogleApiClient, fileId);
file.getMetadata(mGoogleApiClient).addResultCallback(new DemoClassForHandleCallBack());
public class DemoClassForHandleCallBack implements OnMetadataRetrievedCallback{
@Override
public void onMetadataRetrieved(MetadataResult result) {
boolean isSuccess = result.getStatus().isSuccess();
Log.i("is success",""+isSuccess);
Metadata fmd = result.getMetadata();
Log.e("modified date",""+fmd.getModifiedDate());
}
}