Releases: cyface-de/android-utils
Releases · cyface-de/android-utils
5.0.1
5.0.0
Added
- StorageHelper utility class: New getStorageDirectoryWithFallback(context) and getStoragePathWithFallback(context) methods for robust storage selection with automatic fallback from external to internal storage
- StorageType enum: EXTERNAL and INTERNAL values for identifying storage type
- getStorageType(context): Query which storage type is currently being used (useful for UI display)
Breaking Changes
- DiskConsumption.spaceAvailable(): Now requires Context parameter
- Constants.externalCyfaceFolderPath(): Removed - use StorageHelper.getStoragePathWithFallback(context) instead
Changed
- Storage selection now checks if directories are mounted AND writable
- Automatically falls back to internal storage when external is unavailable
- Avoids removable storage (SD cards, USB drives) for reliability
- Added debug logging for storage location selection
- Centralized storage detection logic to avoid code duplication
Migration
// Before
val path = Constants.externalCyfaceFolderPath(context)
DiskConsumption.spaceAvailable()
// After
val path = StorageHelper.getStoragePathWithFallback(context)
DiskConsumption.spaceAvailable(context)
// Display storage type in UI
val storageType = StorageHelper.getStorageType(context)
val label = when (storageType) {
StorageHelper.StorageType.EXTERNAL -> "External Storage"
StorageHelper.StorageType.INTERNAL -> "Internal Storage"
}
4.2.2
Changed: - Upgrade Kotlin plugin
4.2.1
Fixed: - Make android compat and datastore a transitive api-dependency as they are used in API-classes Changed: - Upgrade dependencies and gradle wrapper - Upgrade Java source compatiblilty to 21
4.2.0
Added: - CodeQL workflow Changed: - Upgrade minSdk to 26 (Android 8) - Convert Java to Kotlin - Lint configuration - Add Gradle Cache to all workflows Fixed: - Deprecations - Action Warning: explicitly define permissions
4.1.0
Changed: - AppSettings need to be instantated via getInstance
4.0.9
Changed: - Upgrade DataStore to 1.1.1
4.0.8
Changed: - Upgrade dependencies
4.0.7
Changed: - Upgrade dependencies (Gradle 8, AGP 8, JDK 17, etc)
4.0.6
Changed: - Upgrade dependencies