Comments (2)
Let me give a try to reproduce the issue. I might escalate the problem with the Android storage engineers if it's not related to ModernStorage
from modernstorage.
So I investigated a bit but wasn't able to reproduce the same issue you're getting (at least on an emulator).
Two things to note though, your getExternalStorageDir
is pointing to two different folders. The first one is the app's own Download external folder (which isn't visible by other apps since Android 11, was never supposed to be public to be honest) and the second one is the shared Download folder (visible with a file manager):
# applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)
/storage/emulated/0/Android/data/com.google.modernstorage.storage.test/files/Download
# Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
/storage/emulated/0/Download
On Android 11 (I haven't tried yet on previous versions), it doesn't let me write to the app's own Download external folder. It doesn't trigger an exception but change the target folder by putting it in the device shared Download folder.
I've tried setting the same file name but end up having MediaStore adding a suffix automatically:
# First try
uri = content://media/external/file/65
path = /storage/emulated/0/Download/samefile.pdf
# Second try
uri = content://media/external/file/66
path = /storage/emulated/0/Download/samefile (1).pdf
Could you share me a snippet adding the same file twice from your project just to make sure I'm reproducing it in the same way? Thanks!
from modernstorage.
Related Issues (20)
- Use android extension sdk
- Project dead? HOT 4
- PhotoPicker maxItems not work !!! HOT 1
- IllegalArgumentException: Mutation of _data is not allowed when target Android 14 HOT 1
- Should Locale.ENGLISH be used for lowercasing file extensions? HOT 1
- Migrate sample app to use Jetpack Compose
- Broken links to API reference
- No HOT 1
- [Idea] Add proper ProGuard support
- [Idea] Add better Java support HOT 1
- [Idea] Add deprecation notice for old packages HOT 1
- [Idea] Add Kaspresso for UI Automator testing
- [Idea] Consider adding sample apk to build/release artifacts (similar to compose sample repo) HOT 1
- Running sample fails due to 502, remove jcenter? HOT 3
- Add BOM in guide
- Fully implement Okio Filesystem API
- java.lang.IllegalArgumentException: MIME type HOT 2
- [Idea] AndroidX Activity added ActivityResultContracts$PickVisualMedia. modernstorage-photopicker won't be needed anymore. HOT 1
- Failed to resolve: com.google.modernstorage:modernstorage-permissions:1.0.0-alpha06 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modernstorage.