这怎么可能知道发生了什么Spotify的是从外部Android应用程序打? [英] How is it possible to know what's spotify is playing from an external Android app?

查看:187
本文介绍了这怎么可能知道发生了什么Spotify的是从外部Android应用程序打?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是发现了在Spotify的这个设置选项Android设置屏幕:

I just found out this settings option in Spotify for Android settings screen:

设备广播的地位 - 让您的设备上的其他应用程序,看看有什么   您正在收听的

"Device broadcast status - allow other apps on your device to see what you are listening to"

我想这意味着任何其他应用程序可以访问什么,通过Spotify的播放。这又如何实现?是否有任何文件在吗?

I guess that means any other app can access what's being played via Spotify. How can this be implemented? Is there any documentation around?

感谢

推荐答案

Spotify的有以下意图的行动:

Spotify has the following intent-actions:

metadatachanged, playbackstatechanged,和 queuechanged。

metadatachanged, playbackstatechanged, and queuechanged.

queuechanged 不包含任何额外的数据。
playbackstatechanged 具有打一个布尔值,并为playbackPosition值。
metadatachanged 包含艺术家,专辑,曲目,长度和ID值。

queuechanged contains no extra data.
playbackstatechanged has a boolean value for "playing", and a value for playbackPosition.
metadatachanged contains artist, album, track, length, and id values.

您可以得到艺术家,曲目和专辑名称时的轨道(手动或自动)改变使用 com.spotify.mobile.android.metadatachanged

You can get Artist, Track, and Album names when the track is changed (manually or automatically) by using com.spotify.mobile.android.metadatachanged

如果Spotify的暂停,重新开始,只playbackstatechanged是广播。

If Spotify is paused and started again, only playbackstatechanged is broadcast.

这篇关于这怎么可能知道发生了什么Spotify的是从外部Android应用程序打?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆