Closed JanuszHain closed 3 years ago
Yes, you are correct Google has depreciated the Environment.getExternalStorageDirectory(). Currently, as a workaround you can opt out of these "scoped storage" changes on Android 10 and 11, if your targetSdkVersion is below 30, using android:requestLegacyExternalStorage="true" in the
I will try to implement the fix soon. Thanks for bringing it to my attention and if you already have implement you can issue a PR.
I haven't changed source code, so I can't issue a PR (sorry), but it seems like a quickfix, as class To
has context, so there is only change in few lines to newer method
https://github.com/gyanani-ritika/ContentProvider/blob/main/app/src/main/java/com/example/externalstorage/MyActivity.kt Check out my project in which I am saving a text file in phone's external storage in DOCUMENTS folder with using both, deprecated method (commented out) and MediaStore method.
solution ?
As title says, the library is using deprecated
Environment.getExternalStorageDirectory()
The library in my Android 10 haven't worked. After changing to
MainApp.instance.externalCacheDir
(dir from context) saving and loading started working.