I wanted to download file from google drive. For this I have implemented in Google Drive SDk and used the following method.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CODE_OPENER:
if (resultCode == RESULT_OK) {
DriveId driveId = (DriveId) data.getParcelableExtra(
OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
}
finish();
break;
default:
super.onActivityResult(requestCode, resultCode, data);
}
}
I also tried using output stream but not able to save data to a file.
I have tried searching around this, but couldn't find any useful link which can guide me how to download and store file.
IMO, you should read some useful links below:
Then, please refer to the following snippets, of course when getting the input stream, you can save it to a file in your device instead of printing to Logcat.
Hope it helps!