Android Filing System using LC9
J. Landman Gay
jacque at hyperactivesw.com
Mon Oct 30 15:18:28 EDT 2017
On 10/30/17 4:26 AM, Peter Reid via use-livecode wrote:
> 2. The internal storage area pointed to by specialFolderPath("documents") is Read-Write (RW) and can be used as such. However, the path returned by "documents" is INCORRECT:
>
> /data/data/com.reidit.aphtrain/files
>
> The correct path should be:
>
> /Android/data/com.reidit.aphtrain/files
Not exactly; both are correct. There are two different types of
documents folders; one is app-specific and private to the app. The other
is the public documents folder you can see in a file manager on the
device. The specialFolderPath("documents") points to the private
app-specific folder and is correct. SpecialFolderPath("external
documents") points to the public documents directory.
>
> If I replace the leading "data" with "Android", the path works fully with RW access.
This path points to the general documents folder that other apps can
see. It should be the same as specialFolderPath("external documents").
>
> 3. If I pre-load files & folders onto a microSD card on my computer, I have to place them in a path such as:
>
> /Android/com.reidit.aphtrain/<files & folders>
>
> Such files & folders are Read-Only in the tablet and accessible using the following path:
>
> /storage/sdcard1/Android/com.reidit.aphtrain/<files & folders>
>
> It seems that Android 5 or later (FireOS 5 in my case) locks down SD cards. They used to be fully RW but are now treated as mainly RO apart from an area for the app to use. If I get the path from specialFolderPath("external documents"), the path gives me Read-Write access to the following area:
>
> /storage/emulated/0/Android/data/com.reidit.aphtrain/files/<files & folders>
>
> During the running of the app, the above path works fully for RW access but doesn't show any of the pre-loaded files & folders. However, If I connect the microSD card to my computer again, this area is NOT VISIBLE!
If you are on a Mac, I believe you need special software to access
documents. I know Samsung provides their KIES software for that. I'm not
sure how Windows handles it.
I'm not sure whether FireOS is representative of all versions of Android
OS. Amazon did some heavy customization of their OS so the rules they
use may not be the same as pure Android OS. I don't have a Fire tablet
but if you can get ahold of a different Android device it would be
interesting to see if this behavior is universal.
> Also, specialFolderPath("documents") seems to have a BUG as it delivers the wrong path (in LC 9.0.0-dp9/10).
See above. The path is correct for the app's virtual folder.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list