Can't search and save csv files? - File component - FileScope (Android11)

I want to save the X.Y coordinates on the canvas into a CSV file and open it on the computer but I don't know why I can't save it.

Hello Jasper

Where is 'ARM.csv' stored? Also, what version of Android are you on?
Oops - you are on Android 11. So your file should be stored in the ASD (App Specific Directory) by default. If you want to share the csv outside of the App, it needs to go to a shared folder or the cloud.

Some basics on Android storage system file read write

Why do you think, you can't save it? Did you get an error message? Or did you not find the stored file? Use Total Comnander to find it in ASD... How do you read the file again? Any screenshot of your blocks? Or is your issue something else?
Taifun

I stored the 'ARM.CSV' in my phone and use the "appendtofile" block to add the coordinates to the file. I think after I finish the action, the data I drew will be added to my file, isn't it?

And I also want to ask, if I use Emulator to run my program, can I find my ASD too?

I didn't get any error message. The reason of I thought that is because the CSV file doesn't update after I run my program.

Use Companion on your phone. To be really sure you are getting it right, build an APK. You can use an AfterFileSaved Block to verify that the Append happened. Also, follow the link I gave you to learn about Android Shared folders. There is an excellent diagram by Anke that shows what you can and cannot do. Note, you only need to use Append - if the file doesn't exist, Append will create it.

Snap1

Please let us know which DefaultFileScope and which FileScope you are using.
And post the aia or a small test aia.

Are you saying, you store that file manually somewhere outside of your app? Probably in shared storage? How and where exactly?

See again Some basics on Android storage system

To edit non media files, which are not owned by your app you will need SAF

Taifun

Btw, the Properties of the File component (DefaultScope) should have the same name as the block:

grafik

grafik

Sorry here is my test aia. But I still can't sand the data into my csv file(in my Phone) :disappointed_relieved:. Please tell me what the problem in my aia. :disappointed_relieved:
ARMCSV (1).aia (7.3 KB)

Show your blocks.

Note: On Android 11+ you can save non-media files only in the ASD or one of the Shared folders (/Documents or /Download), but not in the root dir of the external storage or any other arbitrary folder.

Here is my block.

Jasper, you have not studied the Guide even though both myself and Taifun asked you to. We are here to help you help yourself, not to write your code for you.

Try this on your phone as an APK:
SaveShared.aia (4.3 KB)

Sorry to ChrisWard, I have read all the links you and Taifun sent me, and I try to modify my aia but it still didn’t work...So I sent my block hope somebody can give me some advice :disappointed_relieved:

Try the file I uploaded - build an APK.

Did you try my blocks? Post → #17

1 Like

Yes but it still have an error and finally I find the problem :sob: :sob:
I need to change DefauultFileScope to Legacy, thanks to guys help :slightly_smiling_face: