远程控制客户端Android版 [英] Remote control client for Android

查看:392
本文介绍了远程控制客户端Android版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的<一个href="http://developer.android.com/reference/android/media/RemoteControlClient.html">RemoteControlClient被引入在ICS中。这就是锁屏似乎与各种音乐播放器整合的方式。请参阅下面的截图的Spotify的锁屏界面上的一个例子。

The RemoteControlClient was introduced in ICS. That's the way the lock screen seems to be integrating with various music players. See the screenshot below for an example of Spotify on the lock screen.

或许有比从锁定屏幕另一个应用程序与所述集成的球员呢?

Could one from another app than the lock screen integrate with said players as well?

我觉得缺少了一点关于这个问题的文件,但我想结果,如果可能的话,会感到很有趣。

I find the documentation lacking a bit on the subject, but I think the results, if it's possible, could be interesting.

编辑:

迄今取得的进展:无。我已经发现的是, IRemoteControlDisplay 可能有一些参与其中,但我的Andr​​oid / Java的技能是有点欠缺真正理解如何实现它,并实现相同的功能在锁定屏幕上

Progress so far: none. What I've found out is that IRemoteControlDisplay likely has some part in it, but my Android/Java skills are a bit lacking to actually understand how to implement it and achieve the same functionality as on the lock screen.

推荐答案

虽然工作在我的应用程序,我居然发现了如何实现自己的RemoteControlDisplay。

While working on my app I've actually found how to implement your own RemoteControlDisplay.

基本上,你扩展IRemoteControlDisplay $存根,这将消息发送到特殊的处理,此处理程序更新元数据和的事情。然后,通过调用来AudioManager#registerRemoteControlDisplay注册自己的类从IRemoteControlDisplay $存根扩展()。

Basically, you extend IRemoteControlDisplay$Stub, which sends messages to special handler, this handler updates metadata and thing. Then you register your own class extended from IRemoteControlDisplay$Stub by calling to AudioManager#registerRemoteControlDisplay().

然后你通过调用AudioManager#unregisterRemoteControlDisplay()取消注册。

And then you unregister it by calling AudioManager#unregisterRemoteControlDisplay().

这是相当复杂的,但我已经写了这一篇文章如何。 我已经出版了它XDA,在这里查询: <一href="http://forum.xda-developers.com/showthread.php?p=44513199">http://forum.xda-developers.com/showthread.php?p=44513199

It's fairly complex, but I've wrote an article on how to this. I've published it on XDA, check it here: http://forum.xda-developers.com/showthread.php?p=44513199

这篇关于远程控制客户端Android版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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