Page 1 of 1

SpecialFolderPath on android

Posted: Fri Jul 28, 2017 8:34 am
by Peter@multidesk.se
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

Re: SpecialFolderPath on android

Posted: Fri Jul 28, 2017 8:54 am
by jmburnod
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

Re: SpecialFolderPath on android

Posted: Fri Jul 28, 2017 5:01 pm
by bogs
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.

Re: SpecialFolderPath on android

Posted: Mon Jul 31, 2017 11:14 am
by Peter@multidesk.se
Thanks, to both of you

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

///Peter

Re: SpecialFolderPath on android

Posted: Mon Jul 31, 2017 12:42 pm
by Klaus
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