I want to get information about the songs that are being played on Android.

Asked 2 years ago, Updated 2 years ago, 95 views

I'd like to get information about the songs on Android, but I don't know how to get information about the songs being played. Please tell me what code to use.

android

2022-09-30 21:23

1 Answers

I don't think it's possible from the application to get the music information playing any player.


in "specific Player" Google Play Music (com.android.music) can be found by filtering the following actions on Broadcast:

*"com.android.music.metachanged"
* "com.android.music.queuechanged",
* "com.android.music.playbackcomplete"
* "com.android.music.playstatechanged"

GetStringExtra provides the following information:

*"id" - Integer:the database row ID
* "artist" - String: the name of the artist
* "album" - String: the name of the album
* "track" - String: the name of the track
* The int has an action that is one of

Note: https://android.googlesource.com/platform/packages/apps/Music/+/master/src/com/android/music/MediaPlaybackService.java


2022-09-30 21:23

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.