Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Android: how to get current track information

I am coming with an iOS background and don't know how to do this in Android. I have checked many topics about it but couldn't find a solution for this.

I simply want to retrieve the information of the current track playing in Android. In iOS, I would do the following after importing MediaPlayer:

let item = MPMusicPlayerController.systemMusicPlayer().nowPlayingItem

And then item would contain the main information (title, artist, album, artwork...).

Now I'm looking for a simple way to achieve this in Android...

Thanks for your help.

Comments