PyDroid3, how to grant access on sd-card in Android phone on Samsung Galaxy S8? | Sololearn: Learn to code for FREE!

+8

PyDroid3, how to grant access on sd-card in Android phone on Samsung Galaxy S8?

I want to save my Python codes, which I have created with PyDroid3, on the SD-card of my phone. It is all no problem on the internal storage, but when I want to switch to the SD-card while being in the save-file-dialogue, PyDroid3 displays the message "access denied". I have searched in the settings of PyDroid3 and of my phone, and all what could be set in the direction of granting access I have done, but without success. Does anybody have solved this problem without having rooted the phone? If yes, then I would be interested in your experience.

1/7/2021 1:32:04 AM

Jan Markus

4 Answers

New Answer

+8

Unfortunately, there's nothing you can do about this. It is a security "feature" introduced around Android 4.x that changed the access permissions to the external sdcard. In the past, an app would request the "WRITE_EXTERNAL_STORAGE" permission, which would grant write access to all external storages (user/group "sdcard_rw"). This has apparently been changed to only grant write access to the primary external storage. A second permission has been introduced called "WRITE_MEDIA_STORAGE ", which would grant access to the other external storages (user/group "media_rw"). The problem is, a third party will not actually be granted this permission, only system apps and apps provided by the device manufacturer will normally be granted this permission. There are exceptions, apparently on some devices third party apps will be granted this permission, but according to the AOSP sources, they're certainly not supposed to. Many Android browsers won't even read html files stored on external media, and even when they do they may not load the css or JavaScript, won't follow relative links and generally behave unpredictably. Which sucks because I used to keep loads of html documentation on my external sdcards. Basically we've all been Scroogled. It couldn't possibly be anything to do with making people buy new devices with more internal storage instead of using external storage. I'm sure Google and the device manufacturers only have your data security in mind.

+7

Martin Taylor Thank you for your detailed reply. These limitations are too bad. Now I can stop my further research on this topic as it does not help. I had already mistakenly suspected that I was too stupid to operate a certain switch in the system.

+7

Martin Taylor Best alternative would be an open-source smartphone. There may be few on the market according to https://en.m.wikipedia.org/wiki/List_of_open-source_mobile_phones but I have never heard of one of them in the media, and the two ones based on Raspberry Pi I estimate that they are more experimental.

+5

Jan Marcus, this limitation has basically killed my interest in Android development. In the early years of Android I ported a number of cross assemblers and other development tools to Android. Unfortunately, the inability to access the entire filesystem, or even use html documentation on the external sdcard is a deal breaker for me. Who wants to develop an application where rooting your phone is a system requirement?