Anggrayudi SimpleStorage Versions Save

💾 Simplify Android Storage Access Framework for file management across API levels.

1.2.1

2 years ago

Fixes

1.2.0

2 years ago

Features

  • Increase target SDK to 31

1.1.0

2 years ago

Features

  • Added extension functions:
    • DocumentFile.findParent() to overcome DocumentFile.parentFile drawbacks.
    • DocumentFile.childOf()
    • List<MediaFile>.compressToZip()
    • MediaFile.decompressZip()

Breaking Changes

  • ZipCompressionCallback and ZipDecompressionCallback now requires generic data type, i.e. DocumentFile or MediaFile
  • Added ProGuard rules to keep fields in DocumentFile. See storage/consumer-rules.pro

Fixes

  • Fixed issue #79
  • Fixed the sample code

1.0.0

2 years ago

Features

  • Added ZIP compression & decompression (feature #49):
    • List<DocumentFile>.compressToZip()
    • DocumentFile.decompressZip()
  • Added functions:
    • MediaStoreCompat.deleteEmptyMediaFiles()
    • MediaFile.presentsInSafDatabase
    • MediaFile.hasZeroLength
    • MediaFile.presentsInSafDatabase

Breaking Changes

  • Renamed extension function closeStream() to closeStreamQuietly() (issue #60)
  • FileDescription.mimeType now returns appropriate mime type. Using image/* or */* will return application/octet-stream
  • Deleted MediaFile.exists
  • MediaFile.isEmpty now returns true if the file does not exists or has zero length.
  • MediaFile.renameTo() now throws UnsupportedOperationException on Android 10+.

Fixes

  • Fixed issue #76
  • More carefully when substring file extension. Thanks to MimeType.hasExtension()

0.14.0

2 years ago

Features

  • Added initial path for folder picker (#62)

Fixes

  • Fix issue #67

0.13.0

2 years ago

Features

  • Request storage access for specific folder with SimpleStorageHelper.requestStorageAccess(expectedBasePath) on API 30+
  • Create media based on full path with MediaStoreCompat.createMedia()

Breaking Changes

  • Storage runtime permission no longer prompts on API 29+

Fixes

  • Fix issue #54
  • Fix issue #55

0.12.0

2 years ago

Features

  • Multiple files picker (#43).
  • File receiver. Call SimpleStorage.checkIfFileReceived() in onCreate() and onNewIntent(), then FileReceiverCallback will be triggered if any files received via Intent.ACTION_SEND or Intent.ACTION_SEND_MULTIPLE.
  • Lazy init callbacks in SimpleStorageHelper.

0.11.1

2 years ago

Fixes

  • Selecting the root path of external storage on Android 10 (folder picker) now grants access automatically.
  • Better wording for requesting root path access.

0.11.0

2 years ago

Features

  • Added DocumentFile.getFormattedSize() and MediaFile.formattedSize

Breaking Changes

  • Added requiresWriteAccess to:
    • DocumentFileCompat.fromSimplePath()
    • DocumentFileCompat.fromFullPath()
    • DocumentFileCompat.fromFile()

Fixes

  • Android 11 returns RawDocumentFile for DocumentFileCompat.from*(). Fixed by adding requiresWriteAccess.
  • DocumentFile.toTreeDocumentFile() doesn't return null for SingleDocumentFile

0.10.0

2 years ago

Features

  • Supported ComponentActivity (#28).
  • Supported Intent.ACTION_CREATE_DOCUMENT
  • DocumentFile.child() is 36% faster now. It affects the entire library performance, for example mkdirs(), makeFolder(), etc. See this benchmark.

Breaking Changes

  • Removed Dexter because it has been archived. If you're using SimpleStorageHelper and your activities are direct subclass of android.app.Activity, then you need to call onRequestPermissionsResult(). I recommend using ComponentActivity or AppCompatActivity so you don't need to call onRequestPermissionsResult().
  • Removed extension function DocumentFile.doesExist(). Use DocumentFile.child() != null instead.

Fixes

  • DocumentFileCompat.getRootDocumentFile() doesn't return null when the URI permission hasn't been granted yet.