My MP3 Player (MP3 Player)

I just want to share about MP3 Player apps that I just created using App Inventor which I name it "My MP3 Player".

This apps could create playlist from internal memory or SD card and the playlist could be stored in local database (using TinyDB).

When this app run it will check is there any playlist in database or not, if there then it will load playlist into Listview but if database blank then it will check is there SD card or not, if there then it will retrieve mp3 files in SD card but if not there then it will retrieve mp3 files from internal memory.

These functions/features work using icon playlist INT (internal memory), SD (SD card) and PL (playlist from internal memory or SD card that stored in database).

I hope there are some member could check this apps and give feedback to me to improve this apps.

You find this apps via this URL link :
[mod edit: no direct links to files please, provide a landing page, or upload the aia project here]

My_Mp3_Player_New_01.aia

Best regards,
Asri Rusdi

1 Like

You should also give credit here for any extensions used.

Works well in companion.

What happens when the phone/app goes to sleep ?

It only works on Android 13+. You must correctly request READ permissions for Android versions above Android 12 and below Android 13.

See also here: Some basics on Android storage system


In addition, Play/Pause buttons should display the playback status.

Yes you are right that I should say thanks to parties who provided these extensions :

Extension from Pura Vida Apps :

  • TaifunFile for accessing files in SD card or internal memory
  • TaifunPlayer for playing mp3 files

Extension from Ullis Roboter Seite

  • UrsAI2Popup for creating pop up menu

TFormat.aix for convert milli seconds to hh:mm:ss

Music still playing when apps/phone going sleep.

1 Like

Thanks for your input.

How to check version of user's android phone'?
And how to request permission for accessing audio files on older android version?

See e.g. here:

Unfortunately, this is not the case on all devices, so you have two options to ensure that the music continues to play (even in idle mode → option 2):

  1. KeepScreenOn (→ TaifunTools extension)
  2. use a Foreground service (to prevent Doze).

Thanks to your reference.
I will try to take a look more deep to understand it.

Thanks to remind and share this to me.
The summary from your input is there are something need to be considered to make the apps run well on all devices.

Anyone want to test this MP3 app could download the app here...
My_MP3_Player.aia (755.6 KB)

2 Likes

Nice player app, but a few small comments:

  • It would look better if only the music titles were listed in the ListView and not the absolute path, but also no MP3 extension (because only MP3 files are listed anyway).

  • I also have some WAV, FLAC and many M4A & OGG audio files on my devices. So you can think about listing such audio formats too.

  • When a song is selected, the music starts playing. However, the start/play button should not be visible and especially should not be clickable (since the music will then start from the beginning).

  • The pause and stop buttons should also only become visible when the music is playing.

mp
on my Samsung A13 Android 10 with externalSDcard.

has over 500 mp3 files. Same message for internal where I have one mp3. :cry:

Thanks for posting; needs some work.

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.

1 Like

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):

grafik

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)