So, firstly, very new to AppGameKit but enjoying the journey.
I wanted to load a text (html) file from the Downloads directory on the phone.
To cut a long story short, it didn't work so I set out with the file read/write examples.
To my amazement, this worked, unsure of what was different in my code, I added my file read to the example
// write data to a file
OpenToWrite ( 1, "raw:/sdcard/Download/myfile.txt", 0 )
WriteInteger ( 1, 10 )
WriteFloat ( 1, 1.23 )
WriteString ( 1, "hello" )
CloseFile ( 1 )
// reading from a file
OpenToRead ( 1, "raw:/sdcard/Download/myfile.txt" )
a = ReadInteger ( 1 )
b# = ReadFloat ( 1 )
c$ = ReadString ( 1 )
CloseFile ( 1 )
// reading from a file
OpenToRead ( 1, "raw:/sdcard/Download/dungeon.html" )
fileline$=ReadLine(1)
CloseFile ( 1 )
// our main loop
do
print(ScreenFPS())
print("a="+str(a)+" - b#="+str(b#)+" - c$="+c$)
print("fileline$="+fileline$)
print("DONE")
The write and the first read all work as expected but the second read to the html/text file fails with file not found.
Yes, the file is there
I can open it with any other editor on the phone along with Chrome, termux to name a few.
The only difference with this file is that it was created by a different application by I thought that pretty much anything in Documents or Downloads was open to all apps.
Can anyone tell me if I am doing something wrong or if this cannot be done??
Any (constructive) comments are welcome
Thanks
PS. Samsung Android 12