Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4android > Basic4android Updates and Questions
Documentation Wiki Register Members List Windows Mobile Search Today's Posts Mark Forums Read

Basic4android Updates and Questions Updates and questions regarding Basic4android.

Make external media writable

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-10-2013, 01:32 PM
Junior Member
 
Join Date: Jan 2013
Posts: 58
Default Make external media writable

I made this a new thread, hope thats OK

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 as the ES File Explorer Method

Step 1: Open ES File Explorer and select your "menu" button on your phone or android and 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

Code:
    <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

Code:
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 external 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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Millennial Media Ads ssg Additional libraries, classes and official updates 13 12-27-2012 06:30 AM
Media library trinode Basic4android Updates and Questions 5 02-23-2012 08:55 AM
media in APK file Jim T Basic4android Updates and Questions 9 03-30-2011 09:17 PM
Media End Event in Media Player junaidahmed Basic4android Updates and Questions 5 01-23-2011 09:49 PM
How can i make a menu / item make disappear and reappear during runtime ? TWELVE Questions (Windows Mobile) 5 04-22-2010 09:36 AM


All times are GMT. The time now is 01:43 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0