Music-Player-GO icon indicating copy to clipboard operation
Music-Player-GO copied to clipboard

[Q&A]: How can I build MPGO in Android Studio?

Open libregeek opened this issue 1 year ago β€’ 4 comments

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

libregeek avatar Sep 12 '22 17:09 libregeek

You have to select project folder :)

Senza nome

enricocid avatar Sep 13 '22 07:09 enricocid

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?

libregeek avatar Sep 13 '22 09:09 libregeek

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

πŸ˜‰

enricocid avatar Sep 13 '22 10:09 enricocid

Thanks for the quick reply. These are really helpful.

libregeek avatar Sep 13 '22 11:09 libregeek

Closing for now. If you have any questions don't hesitate to add comments πŸ˜‰

enricocid avatar Oct 05 '22 08:10 enricocid