1. initialize the UI control on the Interface
2. Set a click event for the play and pause buttons on the interface to bind the service
Note: You can set the hasBound parameter to check whether the service is started for the first time)
3. Obtain the address of the Music Resource in the onBind method of the service. The system player automatically obtains the address content through the server.
4. (1) Add the internal class MyBinder to the service and inherit the Binder
(2) Add methods in the internal class
(3) In the onBind method, MyBinder binder = new MyBinder ();
Return binder;
(4) Through the preceding three steps, you can call the methods in MyBinder on the interface,
We can use the method included in the System MediaPlayer started in the service to control the playback status.
Note that the response event of the bound service will be obtained by binding the onServiceConnected method in the conn in the service on the interface)