Livecode: write document on Android

Android does not allow apps to write just anywhere as a matter of safety. That’s probably generally a useful feature, but this time I wanted to save data to a text file that is accessible to the user (me). The official guide wasn’t really helpful in this case, because there are ways to save data on Android that are not accessible by the users — e.g. for settings.

Apparently the ‘easiest’ way is to save like this:

set the defaultFolder to specialFolderPath("external documents")
put field "write" into URL ("file:test.txt")

The other (common) special folders (“documents”, “desktop”, “engine”) don’t seem to work on Android.

OK, but where is this file we created? Here:
Local/internal storage/Android/data/com.yourcompany.yourapp/files/test.txt

Not the most intuitive place to me, but whatever, I can access this file from the Android device.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.