Full R/W Access to SD Card - Android 10


Question

I want to use my SD card in such a way that I can take the card out and insert into a Windows PC and access files, but have my Camera and other apps freely write to SD card (so data isn't on phone!).


So far if I format as portable, nothing can write to SD card, but if I format as internal, I cant read outside of phone. I'm running AOSP based Android 10 w/ root. Any suggestions? I'd like to just allow full R/W access to all apps to SD card but not encrypt it basically.


Answer

Since Android 5 write access to the sd-card in portable mode needs to be granted individually for each app. Only apps on a rooted device that are able to use root permissions can bypass this restriction.


For granting write permission the app has to request them in code. Typically it is enough to trigger one write request, e.g. by letting the create a file or folder.


Then Android opens the file application and want's you to select a directory. This is the directory you are granting write permissions for the app, therefore you should select here the path where the sd-card is mounted to, e.g. /storage/A231-7ADF. Usually the sd-card is also shown as quick link on the left side of the files app, so you don't have to know the exact path.


After selecting the sd-card path press the button that is usually something like "Select ..." or "OK". Then you will return to the app you have granted write permission to. To my experience the write request that has triggered the whole process will fail, but every request afterwards will work, if the write-grant-process was performed correctly.


For users doing this the first time it is usually very confusing and you might not be successful on first try. I think it took me several days and multiple attempts before I finally had understood the process and selected the correct folder.


Note that the write permission only works if the app uses the Java/Kotlin Android API to open the files. On file-system level access will be still read-only. This affects especially apps that include generic GNU/Linux native applications that are executed internally as they do not use Android API.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes