How can I import .mp3 files onto a list automatically?

I read the article, it was a bit confusing for me.. But are you telling me that the error is because of time delay?

Perhaps. I can't test your code. Confusing? the article basically says one process must finish before the next process begins. App Inventor is not multi-threaded.

Using an extension with an ActivityStarter link is suspicious. Put a dummy value in place of the KIO4_Base641 and see if the code block runs. Using the AS causes your app to temporarily yield control to an external process. And it may take a few seconds.

However setting the ListView before the for each loop is probably dangerous . Move the Block out of the loop and test with your KIO4 extension and see if running it independently works.

what do you mean by that? are you telling me to add any block?

Sure. Add any Block. You could use a Text Block with 'testing' in it and the list_uri List should contain 'testing' for as many items as there are items in fileList.

I tried like this but it crashed my app.


but when i did it like this:

it didn´t crashed my app, it onlt gave me the The operation split cannot accept the arguments: , [ nothing ], ["/"] error.
I think that the problem here is this block:
Captura de pantalla 2021-08-11 a la(s) 11.42.38

Impossible to help debug your app since you don't share all the code. Gremlins are hiding everywhere.

Here is some possible help Live Development, Testing, and Debugging Tools

Yeah that´s right so, can I share .aia file with you? So that you can see all blocks and and change them..

I realized that if I did it like this it doesn´t return an error and it doesn´t crash the app

yes, and this was the suggested solution by @SteveJG from the beginning...

Taifun

1 Like

Try my test aia: playFromSDcards2.aia (58.8 KB)

Blocks

1 Like

Thanks for sharing that, it help me with the list names :grin:

I think that my app is working now :star_struck:

Does my aia work for you?
I think so. So where is the problem?

Yes it does!

there is no problem, i just need to add the WRITE_EXTERNAL_STORAGE permission properly.

Why ......?

Becuase if not, it gave me an error when trying to play the audio.

This is not true, because the Player component does not need WRITE permission to play an audio file (but only READ if the file is in the external storage outside the ASD).

I´m using @Taifun ´s palyer component, I don´t know if that makes a difference :man_shrugging:

No, why should this make a difference?

I thought it was for accesing files...
But now that I think, for accesing files I need the READ_EXTERNAL_STORAGE. and for saving, I need the WRITE_EXTERNAL_STORAGE
I didn´t knew that I don´t need that permission to play audios..