[Android] include files

J. Landman Gay jacque at hyperactivesw.com
Fri Mar 16 00:49:12 EDT 2012


On 3/15/12 10:41 PM, Nicolas Cueto wrote:
> Hello,
>
> I'm testing a stack on Android. I do not know how to include specific
> files or folders, so that those files, folders and the folders'
> contents become placed on the test device.
>
> For example, I can see this directory listed by my stack when on the
> Android tablet:
>
> /data/app/tmp/
>
> How would I get text files and folders into that directory, i.e.:
>
> /data/app/tmp/file1.txt
> /data/app/tmp/file2.txt
> /data/app/tmp/images/img1.jpg
> /data/app/tmp/images/img2.jpg
>
> All I could come up with was to try the standalone settings' "Copy
> files". But neither the files nor the folder (or the folder's
> contents) become placed on the tablet.

Is your tablet rooted? Users on unrooted devices can't see the /data/ 
folder.

The engine virtualizes all its files, so the ones you put in the Copy 
Files pane are in the apk but they won't show up separately on the 
device. You can access them with a path relative to the engine, like:

  specialFolderPath("engine") & "/file1.txt"

The app can save files to one of the special folders, either "documents" 
or "cache". If it needs to create new files and you want them in a 
user-accessible area on the SD card (where unrooted users can see them) 
then enable the checkbox "Write external storage" in Standalone 
Settings. Then you can create a folder in "/mnt/sdcard/data/" and write 
files there.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list