Does Google fear removable media ?

AndyDroid2012

Member
Licensed User
Longtime User
I have seen this similar question here and all over the internet with vague answers


Why has android made it so difficult to write to /mnt/extsd/ ?

my chinese tablet writes /mnt/sdcard/ OK
mnt/extsd is mounted but read only 8gb storage. e.g. b4a demo signature capture fails with java read-only error.

/etc/permissions/platform.xml is read-only even though I am rooted

RootChecker says I am rooted
So - I can't write extsd because I can't write platform.xml

Any positive suggestions as to how to add the line

<group extsd="media_rw" /> to the xml file

Can I make my Notepad++ app be superuser ? How ?

Somewhere I read that android wiil correct but we are at 4.0.3 or better, so they must know about it, or do they fear a virus ?
 

AndyDroid2012

Member
Licensed User
Longtime User
Thank you DesolateSoul,

So my 8gb chip is a half-useless floppy disk for now. At least we know.

They could at least have given us R/W FAT usage for now, until android v5.0 or whenever. Then the OS would demand the chip be formatted as NTFS before use just like Win.

Their corporate response sounded really flaky, excuses. I hope at least there are red ears during internal focus sessions when questions are asked.
 
Upvote 0

AndyDroid2012

Member
Licensed User
Longtime User
writable extsd success - WOOHOO

Here is how you can make the removable media memory writable.

You will need to get ES File Explorer File Manager from Google Play Store.

Follow these instructions

ES File Explorer Method

Step 1: Open ES File Explorer and select your "menu" button on your phone then select "settings".
You will be checking the checkbox on two options.

Scroll down and check "Root Explorer" and select "yes" for the experimental feature.
Superuser will pop up so "allow" it and check "remember". (maybe old version of ES Explorer, mine did not ask)
Check "Mount File System". Select your "back" button on your phone.

Step 2: You should be at the sdcard partition. /sdcard
Press the back button to go up one folder to Root.
You should now be at root. /

Scroll down and select "etc". You should now be located in /etc.
Press on permissions.
You should now be in /etc/permissions

Step 3: Find platform.xml
Click on the folder and you should be prompted with a menu of choices.
Choose Open
Open with ES Notes Editor

Step 4. Edit the platform.xml in two places, adding new rows
find the WRITE_EXTERNAL_STORAGE permission.
Add an additional group definition for this permission...<group gid="media_rw" />

find the WRITE_MEDIA_STORAGE permission.
Add an additional group definition for this permission...<group gid="sdcard_rw" />

I put this row ahead of the existing media_rw but apparently order is not important

you should now have

B4X:
    <permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
        <group gid="sdcard_rw" />
        <group gid="media_rw" />
    </permission>

    <permission name="android.permission.WRITE_MEDIA_STORAGE" >
        <group gid="sdcard_rw" />
        <group gid="media_rw" />
    </permission>

Save the file.

ES File Explorer will make a copy platform.bak


Step 5: Reboot your android.



TESTING:

I used the screen capture demo here on the forum and changed lines

B4X:
Sub btnSave_Click
 
'   SignatureCapture.Save(SD, File.DirRootExternal & "/Pictures/Screenshots", "sign" & NumberFormat(ctr,0,0)  & ".png")
'   ToastMessageShow("Signature saved to: " & File.Combine(File.DirRootExternal & "/Pictures/Screenshots", "sign" & NumberFormat(ctr,0,0)  & ".png"), True)


   SignatureCapture.Save(SD,  "/mnt/extsd/", "sign" & NumberFormat(ctr,0,0)  & ".png")
   ToastMessageShow("Signature saved to: " & "/mnt/extsd/" & "sign" & NumberFormat(ctr,0,0)  & ".png", True)


   'The next line will load the image and set it as the activity background.
'   Activity.SetBackgroundImage(LoadBitmap(File.DirRootExternal, "sign.png"))
    ctr = ctr +1
   btnClear_Click
End Sub


It worked without any need to add code like android.permission.WRITE_EXTERNAL_STORAGE in my b4a code.


So, yes we can access extsd or whatever name your removable storage is called. Note that the literal extsd is my media in the code in SignatureCapture. Yours may differ.

Maybe the smart guys here do it other ways but for a newbie, this was a scary prospect and I tested doing it a number of times on other files until I became familiar with ES Explorer, afraid I was going to brick the android after reboot.
Anyway, works for me.
 
Last edited:
Upvote 0
Top