I have been testing in my app several api and its these days I have been testing the Google Drive api, the question is the following can list the files of the AppFolder folder, because the state testing and to send files perfect but to list gives me error. Thank you. MY CODE:
apiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this, this)
.addApi(Drive.API)
.addScope(Drive.SCOPE_FILE)
.addScope(Drive.SCOPE_APPFOLDER)
.build();
DriveFolder folder = Drive.DriveApi.getAppFolder(apiClient);
folder.listChildren(apiClient).setResultCallback(
new ResultCallback<DriveApi.MetadataBufferResult>() {
@Override
public void onResult(DriveApi.MetadataBufferResult metadataBufferResult) {
if (metadataBufferResult.getStatus().isSuccess()) {
for(Metadata m: metadataBufferResult.getMetadataBuffer())
//Aqui obtengo los ficheros
Log.i("fichero", "Fichero: " + m.getTitle() + " [" + m.getDriveId().encodeToString() + "]");
}
else {
Log.e("LOGTAG", "Error al listar carpeta");
}
}
});