Browse ( File Picker ) button to import or pick csv & text coordinate file from mobile and draw them on (Bing Maps) map

No I I want the user to be able to pick any csv or text file

from where? assets? shared storage?
try the filepicker component https://ai2-appinventor-mit-edu.ezproxy.canberra.edu.au/reference/components/media.html#FilePicker

btw it is list from csv table...
unknown

Taifun

I CAN NOW PICK ANY TEXT FILE FROM PHONE
USE TEXT CONTENT TO DRAW POINTS ON MAP

blocks(70)
blocks(71)





Congratulations
Taifun

Some files were read without problems, while others gave me an error message


my PointCoordinates1.csv (238 Bytes)

From which directory did you try to pick the file?
When did it work and when not?
Which Android version are you using for your tests?

To read non media files which have been created by other apps you have to use SAF... to pick one of those files i.e. a text file of your choice from shared storage I think you also can use the filepicker component... I'm not 100% sure, because I did not test this...

Taifun

Android version?

android 13

this file working
ffPointCoordinates18.csv (446 Bytes)

location : / internal storage /DOCUMENTS/

but this file not working

my PointCoordinates1.csv (238 Bytes)

location : / internal storage /DOCUMENTS/

The different between them in the content

the second not working content

P1,30.78972106835117,31.40794463947712
P2,30.789692266392713,31.408396843153223
P3,30.78937784449846,31.40859507516323
P4,30.78890340939052,31.408433723527178
P5,30.78879940133065,31.40786165863572
P6,30.789361043320525,31.407554880979642

app read path and name only and cant read content

Try putting both files in the same directory, do they both work / not work ?

two file are in the same path : / internal storage /DOCUMENTS/

I note that

In the emulator the text in the first file copied and give me


the second file not copied

After exporting apk file and try the two file the same error message for two files

Screenshot 2024-06-30 152521

and nothing copied

My guess is that if both files are placed in your ASD, you will be able to open both of them.

Looks like you need to use SAF, if you want to use /Documents with files not created/owned by the app.

The filePicker will get the content uri for the files, but you need to use the SAF extension (or some other SAF method) to open them.

App generate csv file using this block
and i want user to reuse it or open any csv file in his phone

Do your blocks work ?

(If not, it may be better to use Legacy instead of Shared....)

if you store the file with your own app, then later you can access it again easily
however it you stored it with another app, then you need SAF...
everyting is explained here

Taifun

Yes it work and i can export csv without problems

As you are storing the csv files in your ASD, you also could use the FileList method from the file extension to get a list of your stored files and pick one of them without having to copy them to shared storage...

Taifun

I am try to use SAF Extension


I can select the csv file but how i can use the entire text

See this example

See also

Taifun

Finally this method runs without any problems .. up to now :innocent: