I tried to access my data in Google Drive over Google Drive Android API (not Web API). What is crazy, that when I use this access, I can access only small part of disk (just a one folder and a few files). I tried to use example code and still, result is same. Any idea what could be wrong?
Authorizing
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstance);
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Drive.API)
.addScope(Drive.SCOPE_FILE)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
}
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
Reading content
@Override
public void onConnected(Bundle connectionHint) {
super.onConnected(connectionHint);
Query query = new Query.Builder()
.addFilter(Filters.or(
Filters.eq(SearchableField.MIME_TYPE, "text/html"),
Filters.eq(SearchableField.MIME_TYPE, "text/plain")))
.build();
Drive.DriveApi.query(getGoogleApiClient(), query).setResultCallback(metadataCallback);
}
ResultCallback<MetadataBufferResult> childrenRetrievedCallback = new
ResultCallback<MetadataBufferResult>() {
@Override
public void onResult(MetadataBufferResult result) {
if (!result.getStatus().isSuccess()) {
showMessage("Problem while retrieving files");
return;
}
mResultsAdapter.clear();
mResultsAdapter.append(result.getMetadataBuffer());
showMessage("Successfully listed files.");
}
};