Cannot Create A Folder On Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

Cannot Create A Folder On Android

Post by Googie85 » Sun Jun 21, 2020 6:38 am

Hi Guys,

I am having some difficulties creating a folder on my Android device. I do not want to use "specialfolderpath("documents")" rather, use the Android file system.

I have enabled "Write External" in the Standalone App Settings.

Any help would be greatly appreciated!

Thanks,

Googie.

P.S. I have done this before and know it is possible, but cant remember how I achieved it!

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Cannot Create A Folder On Android

Post by richmond62 » Sun Jun 21, 2020 8:12 am

P.S. I have done this before and know it is possible, but cant remember how I achieved it!
How true, how true: I fathered 2 sons this way. 8)

https://forums.livecode.com/viewtopic.php?t=10409
-
Screenshot 2020-06-21 at 10.13.27.png

Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

Re: Cannot Create A Folder On Android

Post by Googie85 » Sun Jun 21, 2020 8:14 am

I have solved this issue!

Code: Select all

   create folder "/storage/emulated/0/Temp Files"
Thanks,

Googie.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Cannot Create A Folder On Android

Post by richmond62 » Sun Jun 21, 2020 8:16 am

Um . . . don't you have a "funny feeling" about creating a folder inside
something called "Temp Files" ?

That would suggest to me that a folder created there will not persist between restarts.

The recipe from 2011 I referenced puts a new folder inside a "documents" folder: might be a better bet.

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Cannot Create A Folder On Android

Post by SparkOut » Sun Jun 21, 2020 9:25 am

Maybe the use case is for temporary files? But anyway I think Android file system locations are notoriously varied. I don't know whether much has changed to streamline the file path on more recent Android versions but in the past you couldn't always rely on a hard-coded path being the same on different devices. Maybe specialFolderPath("external documents") is more useful. This should resolve to a path accessible by other apps on the device whatever the version.

Post Reply

Return to “Android Deployment”