Anke
August 16, 2021, 12:50pm
21
There are some files because I did a lot of tests before. (But these are old files.)
Did you copy / save this file (in the folder /Download
)?
If so, can you show the blocks?
EDIT : I checked it again. Yes, your test app creates this file.
So it should also be possible to save it in → /Documents
.
Great ! Thank you.
2 Likes
Krish
August 16, 2021, 12:59pm
22
I am passing the path Documents as shown in blocks image, but it saves it to Download folder .
1 Like
Anke
August 16, 2021, 4:38pm
23
What does that mean? Isn’t it possible to save / copy a non-media file in /Documents
?
I think it should be possible.
Btw, shouldn’t the shared folders be → /Downloads
(not → /Download
)?
1 Like
Anke
August 16, 2021, 4:42pm
24
This Scoped storage stuff is really confusing .
2 Likes
Anke
August 16, 2021, 5:17pm
25
And why is the fileName “Documents_WooHoo.txt
” and not only “WooHoo.txt
” ?
(FileScope.Asset, "WooHoo.txt", FileScope.Shared, "/Documents/WooHoo.txt")
1 Like
Anke
August 16, 2021, 5:25pm
26
Did you use the Storage Access Framework (SAF
) to save (copy) the file?
I think so, but I want to be sure.
1 Like
Krish
August 17, 2021, 10:00am
27
I think it depends device by device, my device don’t even have Downloads folder, everything is saved in Download folder.
It’s same as of appinventor.
1 Like
Anke
August 17, 2021, 10:58am
28
My Android 11 test device (Pixel 2XL) initially didn’t have a folder /Downloads
either, so I created it. Nevertheless, the text file is copied to /Download
.
2 Likes
Krish
August 17, 2021, 11:03am
29
Maybe because device prefers that path instead of ‘Downloads’
1 Like
Anke
August 17, 2021, 11:11am
30
Ok, but then it shouldn’t make any difference what path I enter here (instead of /Documents
or /Downloads
), it is always saved in the /Download
folder.
I think it shouldn’t be like that.
1 Like
Anke
August 17, 2021, 11:17am
31
I think that the MIT team is also struggling with this …
because we are still waiting for the targetSdkVersion = 30
update from AI2.
And there are still some issues and bugs on the AI2 test server.
Krish
August 17, 2021, 11:59am
32
Okay, it seems it’s working well and file is being stored in Documents folder, The issue was that toFileName cannot have slash in starting.
These are the current blocks :
Demo Apk -
FileTest (6).apk (4.6 MB)
Note - It seems non media files can only be stored in either Download folder or Documents folder or there will be a IOException.
2 Likes
Anke
August 17, 2021, 12:16pm
33
Ahh … good to know.
Yes correct, I checked it.
Light comes slowly into the darkness.
Thank you very much!
1 Like
Anke
August 17, 2021, 1:04pm
34
Last question :
Why does this crash on the AI2 test server (Companion & APK)?
So what did you need to fix it?
1 Like
Krish
August 17, 2021, 4:36pm
35
Appinventor is crashing probably because their code is incomplete, They are probably still working on it
2 Likes
Anke
August 18, 2021, 9:32am
36
Just for your information:
And sorry , but another question:
How it is possible that this (APK) works without using any method regarding “shared storage” (FileScope.Shared
): testFileApi30.apk (3.3 MB) (→ built on the AI2 test server ).
Blocks
Steps to test the app (especially on Android 10 and 11):
Install the APK and test … it will work.
Unistall and reinstall it. Now it does no longer work.
Then check the CheckBox
and try again … it should work again …
I tested this APK on a Pixel 2XL (Android 11).
See also here:
Here is a test app that saves a text file in the → /Download and → /Documents folders (without WRITE permission, as this is no longer available on Android 11). Note: The file names have to be changed with each button click, otherwise it will only...
Anke
August 18, 2021, 10:05am
37
Btw, same behavior with Niotron:
I imported the AIA and built the APK.
testFileApi30_Nio.apk (4.6 MB)
Krish
August 18, 2021, 10:10am
38
I am not sure what’s the issue here
I installed the app in a device with Android 10, file saving works well and after uninstalling and reinstalling it seems to work well without checking the checkbox, just count resets as tinydb data would be cleared.
Anke
August 18, 2021, 10:14am
39
Try to remove the created (saved) text files from /Download
and /Documents
.
(I did this via USB connection from my computer .)
Then it should no longer work without checking the CheckBox.
Krish
August 18, 2021, 10:17am
40
Okay, just tried
Still working without any issue