SpecialFolderPath on android

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

SpecialFolderPath on android

Post by Peter@multidesk.se » Fri Jul 28, 2017 8:34 am

Now I've got stuck!

I can not save a text file on my Android phone, I use:

set the defaultFolder to specialFolderPath ("documents")
put theList into URL ("file:kkguid3.txt")

But nothing happens, I can not see any file created on my phone, so I'm trying to load the file with:

set the defaultFolder to specialFolderPath ("documents")
put URL ("file:file:kkguid3.txt") into x
answer x

Then I get "false" in return

I have also tried to build a stand alone with LC 9 to use the remote debugger but that build crashes immediately at start up.
Is there anyone else who has had this problem with LC9 and Android?

What am I doing wrong?

///Peter
/*Whats all the fuss with c# ?*/

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: SpecialFolderPath on android

Post by jmburnod » Fri Jul 28, 2017 8:54 am

Hi Peter,
I'm not an androïd expert but probably

Code: Select all

put specialFolderPath ("documents") & "/" & "kkguid3.txt" into tMyPath
put theList into URL ("file:" & tMyPath)
Best regards
Jean-Marc
https://alternatic.ch

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: SpecialFolderPath on android

Post by bogs » Fri Jul 28, 2017 5:01 pm

Peter@multidesk.se wrote:...
But nothing happens, I can not see any file created on my phone, so I'm trying to load the file with:

Code: Select all

 set the defaultFolder to specialFolderPath ("documents")
   put URL ("file:file:kkguid3.txt") into x
   answer x
Then I get "false" in return
On the loading part, you only need one file statement, like your first url -

Code: Select all

 set the defaultFolder to specialFolderPath ("documents")
   put URL ("file:kkguid3.txt") into x
   answer x
Ditto on what Jean-Marc said to try.
Image

Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

Re: SpecialFolderPath on android

Post by Peter@multidesk.se » Mon Jul 31, 2017 11:14 am

Thanks, to both of you

It is so self-explanatory that the entire pathway must be declared. Why could not I see that? ;-)

///Peter
/*Whats all the fuss with c# ?*/

Klaus
Posts: 13822
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: SpecialFolderPath on android

Post by Klaus » Mon Jul 31, 2017 12:42 pm

Since this technique (setting the defaultfolder first) works on desktop it also SHOULD work on mobile, too!
If it doesn't, I would consider this a bug.

However, why messing around with the defaultfolder when we can provide an absolute pathname?
At least that is the maxim I am acting upon from the very beginning. :D

Post Reply

Return to “Android Deployment”