Music-Player-GO
Music-Player-GO copied to clipboard
[Q&A]: How can I build MPGO in Android Studio?
What are You thinking?
I am a newbie in Android Development and trying to understand how Music Player Go works under the hood. I cloned the repository on Android Studio and tried to build the application without any changes to the source code. Could you please help me to build and run the app on an emulator?
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
You have to select project folder :)
Thanks a lot. It worked.
I am curious how you implemented reading metadata from files. Is there any document which describes the approach you have implemented?
To get songs and metadata you have to run a query on Android MediaStore
https://github.com/enricocid/Music-Player-GO/blob/d323e830371e0f36fba6b804b420a130676303e5/project/app/src/main/java/com/iven/musicplayergo/MusicViewModel.kt#L88
Official docs:
https://developer.android.com/training/data-storage/shared/media
For bitrate
https://github.com/enricocid/Music-Player-GO/blob/d323e830371e0f36fba6b804b420a130676303e5/project/app/src/main/java/com/iven/musicplayergo/extensions/MusicExts.kt#L76
https://developer.android.com/reference/android/media/MediaExtractor
Albums embedded covers
https://github.com/enricocid/Music-Player-GO/blob/d323e830371e0f36fba6b804b420a130676303e5/project/app/src/main/java/com/iven/musicplayergo/extensions/MusicExts.kt#L93
I just appended the given id (content://media/external/audio/albumart") to the end of the song uri https://developer.android.com/reference/android/content/ContentUris
π
Thanks for the quick reply. These are really helpful.
Closing for now. If you have any questions don't hesitate to add comments π