This is the optimized version of the previously created music player, because it previously put the control music playing in the activity, this version has already been placed in the Service, in the service to control the playing of music, broadcastreceiver Transmits some data and stops playing music when a call arrives. Of course, there is also the song rejection function of the previous version, which uses an acceleration sensor to control the pause of playing music. The most outstanding feature is the addition of the lyrics synchronization function, which truly achieves synchronous playback of music lyrics. Let's take a look at the following:
The main interface is still the same as before. Click a new one to enter the playback interface:
There is no difference in appearance from the previous version. Actually, a service control playing is enabled, and the next and next buttons below won't die at will.
Finally, let's take a look at the lyrics synchronization:
OK! Okay. Finally, test the function. Finally, we provide the source code for the android music player for interested friends to learn ).