Last active
March 6, 2023 15:56
-
-
Save Xiryl/2ab4f71c3d2a1c68e27311f0f78596f9 to your computer and use it in GitHub Desktop.
driveapimedium-github-4
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
viewModelScope.launch(Dispatchers.IO) { | |
// Define a Folder | |
val gFolder = com.google.api.services.drive.model.File() | |
// Set file name and MIME | |
gFolder.name = "My Cool Folder Name" | |
gFolder.mimeType = "application/vnd.google-apps.folder" | |
// You can also specify where to create the new Google folder | |
// passing a parent Folder Id | |
val parents: MutableList<String> = ArrayList(1) | |
parents.add("your_parent_folder_id_here") | |
gFolder.parents = parents | |
drive.Files().create(gFolder).setFields("id").execute() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment