AppInventor won't save to my tablet's SD card

170 views
Skip to first unread message

Willis

unread,
Oct 10, 2019, 6:54:58 PM10/10/19
to MIT App Inventor Forum
I am trying a simple program to enter text and save it to a file on my Samsung tablet. I can save it to Internal Storage/AppInventor/data without using the prefix"/" before my file, but what I want to do is save the file to the tablet's SD card so I can use the file in my desktop computer's applications.. I used the prefix "/' but can't find the file anywhere on the SD card. The documentation states that is where it should go. I tried adding a "sdcard" folder in my SD card drive but that didn't help. Should I use a JOIN block and add the "/" symbol to my file name?

Any ideas why I can't save to the SD card??

Confused!
save_a_file.png

SteveJG

unread,
Oct 10, 2019, 9:18:08 PM10/10/19
to MIT App Inventor Forum
By SD card, you mean the 'external SD card'   You cannot copy to the external card with the native File component.... here is a discussion about how you can copy using Taifun's file component ( https://puravidaapps.com/file.php ) and write to the external card in a limited way (see Taifun's documentation under Copy ) on some devices and operating system versions.  The extension might work for you Willis.

You might try it and see if it works on your device.

Regards,
Steve

Willis

unread,
Oct 15, 2019, 6:51:59 PM10/15/19
to MIT App Inventor Forum
Hi Steve,

Thank you for the lead on Taifun's files..They may do the trick!  I do think the description of writing to a file on a SD card on the AppInventor website is very misleading. It could be that, historically, SD meant the internal "hard drive" in a phone or tablet but has morphed into the physical card that is inserted in the device. Perhaps that should be cleared up.

BodyMindPower

unread,
Oct 16, 2019, 7:18:11 AM10/16/19
to mitappinv...@googlegroups.com
For clarification:

From an Android point of view there are an Internal Storage and an External Storage.

1. Internal Storage
In the Internal Storage, the app package is saved:
/data/data/<app packageName>/
which can only be accessed with a rooted device.

2. External Storage
The root directory of the External Storage is:
/storage/emulated/0/

2.1. App-specific directory
In addition, there may be an app-specific directory (which can be created with Taifun's File extension: https://puravidaapps.com/file.php)
/storage/emulated/0/Android/data/<app packageName>/files)
which is saved in the External (private) Storage, but does not require READ_ / WRITE_EXTERNAL_STORAGE permissions.
This app-specific (private) folder can only be accessed by your app.
See: https://developer.android.com/reference/android/Manifest.permission.html#READ_EXTERNAL_STORAGE

2.2. Removable (micro) SD card
There may also be another external storage: a removable (micro) SD card (eg: /storage/82C3-E96C/)that can only be read (on modern Android systems).

Note: The root directory of the External Storage /storage/emulated/0/ is displayed on the device as Internal Storage (unfortunately this is a bit ambiguous).


Reply all
Reply to author
Forward
0 new messages