Android Filing System using LC9
Peter Reid
preid at reidit.co.uk
Mon Oct 30 05:26:58 EDT 2017
I've investigated further the way the Android filing system seems to be available to LC 9.0.0-dp10. As I reported previously, I have found several anomalies.
Here's what I've found, (with my app being identified as "com.reidit.aphtrain" in the examples):
1. The internal storage area pointed to by specialFolderPath("engine") or specialFolderPath("resources") is Read-Only (RO) and contains any files & folder specified in Standalone settings to be included in the Copy Files section. Specifically, the path returned by "engine"/"resources" is:
/data/app/com.reidit.aphtrain-2/base.apk
This can be accessed RO reliably and seems to be the correct behaviour.
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
If I replace the leading "data" with "Android", the path works fully with RW access.
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!
In summary, we seem to have the following available in LC 9:
WHERE SPECIAL ACCESS TABLET? MAC? PATH
1. internal "engine" RO Yes No /data/app/com.reidit.aphtrain-2/base.apk
2. internal "documents" RW ERROR No /data/data/com.reidit.aphtrain/files
3. internal "documents"* RW Yes No /Android/data/com.reidit.aphtrain/files
4. external "external doc" RW Yes NO /storage/emulated/0/Android/data/com.reidit.aphtrain/files
5. external "external doc"* RO Yes Yes /storage/sdcard1/Android/com.reidit.aphtrain
The result of the above is that it is difficult creating files & folders on the fly that you can get out of the tablet afterwards such that they can be read on a computer!
Can anyone confirm my findings and make recommendations?
Also, specialFolderPath("documents") seems to have a BUG as it delivers the wrong path (in LC 9.0.0-dp9/10).
Thanks
Peter
More information about the use-livecode
mailing list