How to get the Information of the music track playing on an Android device?

前端 未结 2 1373
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-18 11:28

I want to get the Information of the Music track playing on an Android device. Is there any Android-powered API available for this? Or do I have to write a plugin for respec

2条回答
  •  攒了一身酷
    2020-12-18 12:10

    I'm new to Android and I don't know how this is done. But! I know that the last.fm Android app must do this, because it displays the info from the currently playing media player track, and "scrobbles" (sends a list of tracks you play in Android's media player to their site). And, I also know that their app is open source. The code is here: https://github.com/c99koder/lastfm-android/

    So, if you have the time, you should be able to search through their code and figure out how they did it.

提交回复
热议问题