Skip to content

Latest commit

 

History

History
260 lines (195 loc) · 6.91 KB

File metadata and controls

260 lines (195 loc) · 6.91 KB

TODO.md - Android Google Drive Sync Library

Track outstanding tasks, features, and improvements


Phase 1: Project Setup

  • Create Gradle project structure with library and sample modules
  • Configure build.gradle.kts with required dependencies
  • Set up Hilt dependency injection
  • Configure detekt for code quality
  • Create .gitignore with appropriate rules
  • Set up GitHub Actions CI pipeline
  • Configure library publishing (Maven)

Phase 2: Core Infrastructure

Authentication Module (auth/)

  • Implement GoogleAuthManager with Google Sign-In
  • Handle OAuth2 token management and refresh
  • Create AuthState sealed class for auth states
  • Create AuthResult sealed class for auth operations
  • Create AuthConfig data class for configuration
  • Add sign-out and account switching support
  • Write unit tests for auth flows (requires Android framework mocking)

Drive Operations Module (drive/)

  • Implement DriveService wrapper for Drive API v3
  • Create DriveFileOperations for CRUD operations
    • Upload file (create/update)
    • Download file
    • Delete file
    • List files with pagination
    • Get file metadata
  • Implement DriveFolderManager for folder hierarchy
    • Create folder
    • Find folder by name/path
    • Ensure folder hierarchy exists
  • Define DriveModels data classes (DriveFile, DriveFolder, DriveOperationResult, etc.)
  • Write comprehensive tests

Local File Module (local/)

  • Implement LocalFileManager for local file I/O
  • Create FileHasher with MD5 and SHA256 support
  • Implement FileFilter for include/exclude patterns
    • Glob pattern matching
    • Extension filtering
    • Size filtering
    • Hidden file handling
  • Write tests for FileFilter
  • Write tests for FileHasher

Resilience Module (resilience/)

  • Implement RetryPolicy with exponential backoff
  • Create NetworkMonitor for connectivity checking
  • Implement SyncProgressManager for progress tracking
  • Write tests for RetryPolicy

Dependency Injection (di/)

  • Create GoogleSyncModule Hilt module
  • Configure all singleton dependencies

Phase 3: Sync Engine

Sync Core (sync/)

  • Implement SyncManager as main orchestrator
  • Create SyncEngine with core sync logic
    • Upload flow with checksum comparison
    • Download flow with checksum comparison
    • Full bidirectional sync
    • Delta sync (changes only)
  • Implement SyncPolicy strategies
    • Upload-only mode
    • Download-only mode
    • Bidirectional mode
    • Mirror mode (exact replica)
  • Create ConflictResolver with policies
    • LOCAL_WINS
    • REMOTE_WINS
    • NEWER_WINS
    • KEEP_BOTH
    • ASK_USER (callback)
    • SKIP
  • Implement SyncState tracking
  • Add progress reporting via Flow
  • Write tests for ConflictResolver
  • Write tests for SyncModels
  • Write tests for SyncEngine (integration tests)

Cache Layer (cache/)

  • Implement SyncCache for metadata caching
  • Create manifest caching with disk persistence
  • Define CacheConfig for invalidation rules
  • Add cache persistence (JSON file-based)
  • Write cache tests

Phase 4: Resilience & Background Sync

Resilience Module (resilience/)

  • Implement RetryPolicy with exponential backoff
  • Create NetworkMonitor for connectivity checking
  • Implement error recovery via retry policies
  • Add operation queueing for offline support
  • Handle rate limiting gracefully
  • Write resilience tests

Worker Module (worker/)

  • Implement SyncWorker for WorkManager
  • Create SyncScheduler for periodic scheduling
  • Define SyncScheduleConfig configuration
  • Add one-time sync work support
  • Implement sync notifications (optional)
  • Write worker tests

Phase 5: Public API

API Module (api/)

  • Design and implement GoogleSyncClient class
  • Create SyncClientConfigBuilder builder
  • Define SyncResult sealed class hierarchy
  • Implement progress observation via StateFlow
  • Create SyncOptions for operation customization
  • Add backup/restore API
    • Create ZIP backup
    • Restore from backup
    • List available backups
  • Write API documentation (KDoc)
  • Create integration tests

Phase 6: Persistence (Optional)

Database Module (db/)

  • Create SyncDatabase with Room
  • Define SyncStateEntity for tracking
  • Implement SyncStateDao with queries
  • Add migration support
  • Write database tests

Phase 7: Sample App

  • Create sample app module
  • Implement sign-in screen
  • Create sync status dashboard
  • Add file browser with file management
  • Implement manual sync trigger
  • Add settings for sync configuration
  • Show sync history/logs
  • Test on multiple devices

Phase 8: Documentation & Polish

Documentation

  • Write comprehensive README.md
  • Create INTEGRATION.md guide
  • Document CONFIGURATION.md options
  • Write TROUBLESHOOTING.md
  • Add inline code examples
  • Create API reference (KDoc)

Quality Assurance

  • Achieve 80%+ test coverage
  • Pass all detekt checks (with baseline for complex methods)
  • Review and optimize performance
  • Memory leak testing
  • Large file handling tests
  • Stress testing with many files

Release Preparation

  • Version 1.0.0 feature freeze
  • Final documentation review
  • Create CHANGELOG.md
  • Prepare Maven Central publishing
  • Create GitHub release

Future Enhancements (Post 1.0)

Features

  • Support for Google Drive Shared Drives
  • Selective folder sync (choose specific folders)
  • Real-time sync with Drive push notifications
  • Encryption at rest (encrypt files before upload)
  • Multi-device safety with instance ID validation
  • Sync metadata file for change detection
  • Batch processing with rate limit avoidance
  • Progress timeout monitoring
  • Compression before upload
  • Bandwidth throttling
  • Sync pause/resume
  • Sync queue with priority

Platform Support

  • Kotlin Multiplatform (KMP) support
  • Desktop (JVM) support
  • iOS via KMP

Integrations

  • Support for other cloud providers (OneDrive, Dropbox)
  • SAF (Storage Access Framework) integration
  • Content provider support

Performance

  • Chunked upload for large files
  • Parallel upload/download
  • Resume interrupted transfers
  • Smart batching of operations

Known Issues

Track bugs and issues here


Notes

  • Reference vane-client-manager for proven patterns
  • Reference vane-spark-notes for sync implementation details
  • Prioritize reliability over features
  • Test on real devices with real Drive accounts
  • Consider quota limits and rate limiting

Last Updated: 2026-01-13