Search code examples
androidandroid-studiogradlemp3

How to Register New File Type Association with MP3


I am beginner with Android Studio. I have an MP3 file in my res\raw folder. When I sync project with Gradle files. I get the following dialog box:

enter image description here

How do I allow for MP3 files in my project?

I read this: Register new file type in Android, but I'm not building an MP3 player. My intention is for the user to have an MP3 player currently installed on their device.

I also tried navigating to File -> Settings -> Plugins and searching for an MP3 player for Android Studio.

Should I just select Text files and move on?

I do not need Android Studio to play MP3 files.


Solution

  • That window is just how you want Android studio to open the file so you can visualize/listen to the file. It does not affect how the file is handled by android at all.

    Since Android Studio does not have a media player, I suggest you to select Open matching files in associated application That will launch your default music player and play that mp3.

    Note: remember that all the files under res should ONLY contain lowercase letters, numbers and underscores. If you have your mp3 with the wrong name conditions will not compile.