How chromeos/android-google-drive-backup-sample works
This Android sample lets a user authorize Drive access, manage app text files through the activity, and optionally schedule background file updates. The README identifies the activity as the authorization and service-creation entry point, the ViewModel as the UI-to-Drive coordinator, and WorkManager as the background mechanism. Source excerpts were not provided, so relationships below rely on README statements; implementation details beyond those statements are omitted.
Main entry points: FileViewModel.kt File ViewModel · MainActivity.kt Main activity · DriveUploadWorker.kt Drive upload worker · DriveUploadWorkerFactory.kt Worker factory
Components 10
Foreground Drive access
- Main activity
app/src/main/java/com/example/drivebackupsample/MainActivity.kt - File ViewModel
app/src/main/java/com/example/drivebackupsample/FileViewModel.kt - Drive extensions
app/src/main/java/com/example/drivebackupsample/DriveExtensions.kt
Background updates
- WorkManager
- Worker factory
app/src/main/java/com/example/drivebackupsample/DriveUploadWorkerFactory.kt - Drive upload worker
app/src/main/java/com/example/drivebackupsample/DriveUploadWorker.kt
Drive storage
- Drive service
- Drive API
- My Drive files
Other components
- User
Connections 13
- User → Main activity: uses controls
README.md - Main activity → Drive service: authorizes and creates
README.md - Main activity → File ViewModel: exposes actions
README.md - File ViewModel → Drive extensions: uses
README.md - File ViewModel → Drive API: makes file calls
README.md - Drive service → File ViewModel: provides authorized client
README.md - Drive API → My Drive files: queries and updates
README.md - File ViewModel → My Drive files: creates and edits text files
README.md - File ViewModel → WorkManager: schedules background updates
README.md - WorkManager → Worker factory: creates workers
README.md - Worker factory → Drive upload worker: creates
README.md - Drive upload worker → Drive service: uses API client
README.md - Drive upload worker → My Drive files: updates or creates files
README.md