Also you must request READ_EXTERNAL_STORAGE
permission on Android < 13:
I will try first on my old Oppo phone to get experience as yours.
Hope I could fix my app for your problem.
Hi Anke,
To get all desired extension files (wav,flac,mp4,ogg,mp3 files) could taifun file extension support it?
If can what we need to put on extension block?
Yes. There are different approaches to this. I think this one is probably the easiest and quickest to implement:
From one of my test devices (without a removable micro SDcard):
This code change
allows me to see the List of mp3 on the external SD.
I changed the index from 5 to 1 as shown above.
I still cannot retrieve from the internal SD but I only have one mp3 on it.
Thank you for your app. :
Almost the same blocks for listing audio files from a micro SDcard:
From one of my test devices with a removable micro SD card:
Hi Anke,
Thanks for your guidance.
I already update my app as your input.
You may want to test it to check .
My_Mp3_Player_Testing.aia (903.4 KB)
I am sorry I got difficulties to fix this issue (List Index too large) because the app could run well on my android 13 device but failed to run on my android 10 device.
May someone could give input how to solve this issue.
Thank you
My_Mp3_Player_Testing.aia (903.4 KB)
Look for where you used the text 'project_state'
No text 'project_state' on my block code.
I got the exact root cause of problem by put this block:
The root cause of problem should be this block:
Anyone could assist what's wrong with the IF block?
Hi MIT App Inventor team,
May I conclude the root cause of problem is the Taifun file extension cannot working well on retrieving files list in internal memory and SD card in Android 10 devices based on my below checking?
Please advice.
Thanks
Try this app on all your test devices (especially Android 10, 13, 14):
I've found that on older devices it can take up to 30 seconds to list 700-850 audio files. On Android 10, 13 or 14 test devices, 400-850 audio files were listed in 1-2 seconds.
No, but just check it with my app on your Android 10 device. My app uses @Taifun's File extension. However, it should also work with Sunny's (@vknow360 ) FileTools extension.
Your method of listing the audio files is unnecessarily complicated and, as you can see, it is also prone to errors. Some devices may contain files (especially in the cache) that do not have an extension. This is why you get the error you know:
Of course the error can be caught:
but the blocks are getting bigger, more confusing and probably more computationally intensive and therefore possibly slower.
The way I have described is much easier and possible errors are avoided.
Hi Anke,
Already working well now on android 10 and 13 with the following fixing block code.
Thank you very much for your input and guidance.
My_Mp3_Player_Testing (1).aia (901.9 KB)
I already fix the app and I hope could running well on your android 10 as the following fixing block code.
My_Mp3_Player_Testing (1).aia (901.9 KB)
Thank you very much for your input to my app.
I already updated the app to add feature "Filter audio files extension" to make user could select what audio files extension (mp3, m4a, wav, midi, flac, and ogg) he/she want to be included in playlist.
To do it click menu "Filter audio files extension" from popup menu on top right of screen then click button(s) of audio files extension you want to be included in playlist till the background of button change to green. You need to refresh your current playlist to make your change take effect. The default of audio file extension included in playlist only mp3 files till you change it.
My_Mp3_Player_v2.aia (972.2 KB)
A great app. Cheers and thank you