0

I'm currently developing a custom SystemUI for Android, so I have no permission Problems.

I want a "Mediaplayer Widget" like on the Lockscreen. I think I can easily control the default Mediaplayer (or any Mediaplayer?) by injecting KeyEvents to the System.

My Problem is: How can I ensure to get updated about songchanges and opening/closing the Mediaplayer?.

Update

I found the Source of the ScreenLock and found the Code for IRemoteControlDisplay but now I dont't know how to use it. I tried to Debug it and it appears, that right after initalization, the onListenerDetached method gets called twice...

chuck258
  • 912
  • 7
  • 16

1 Answers1

1

Your question seems to be answered already. I just researched and got the following links that might help you.

It is clear that you have to work on running a service to monitor the changes using listeners such as: OnBufferingUpdateListener, OnCompletionListener, OnErrorListener, OnInfoListener, OnPreparedListener.

State change listener for MediaPlayer

Android music player app: how to set a complete listener for media player that is running in a service?

Listen to volume changes:

Is there a listener to listen for changes in the volume in android?

Constantly check for volume change in Android services

Hope this helps.

Community
  • 1
  • 1
Karan Sharma
  • 2,353
  • 4
  • 28
  • 46
  • Thanks, but I don't want to work with a own MediaPlayer Object, I want to receive updates from any MediaPlayer (e.g. Google Play Music, Spirit, ... ) any MediaPlayer (App) that shows controls on the Lockscreen – chuck258 Oct 28 '13 at 10:38