Created
February 11, 2023 12:57
-
-
Save Xiryl/b716be9c707e7a0311de4c36675aec15 to your computer and use it in GitHub Desktop.
driveapimedium-github-3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GoogleSignIn.getLastSignedInAccount(context)?.let { googleAccount -> | |
// get credentials | |
val credential = GoogleAccountCredential.usingOAuth2( | |
context, listOf(DriveScopes.DRIVE, DriveScopes.DRIVE_FILE) | |
) | |
credential.selectedAccount = googleAccount.account!! | |
// get Drive Instance | |
val drive = Drive | |
.Builder( | |
AndroidHttp.newCompatibleTransport(), | |
JacksonFactory.getDefaultInstance(), | |
credential | |
) | |
.setApplicationName(context.getString(R.string.app_name)) | |
.build() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the Drive library?