Background music implementation of Android studio 3.0 service project

This article is to realize the background music in the service project by learning Android studio, and the e-mail sending function is used for the in class quiz. There are also need pits and mistakes, which have been solved in the end. Let's learn together. If you have a better way, you can discuss it in the message area below.

In this project, I was mainly responsible for the back-end of Android studio and game copywriting and game planning. Later, things were too scattered. Android studio didn't learn very well. After writing the copywriting, I helped write the database insertion statement, and then I completed the background insertion sound code of as with my teammates. Next, the service project is used for the implementation of background music, and the sending of e-mail is used for the sending of e-mail in the classroom quiz.

Development based service

The activity can present a user interface, but the service runs in the background. Try the following example to start the service and pass data from the activity to the service.

This is used to complete the task of transferring data from activity to service. After that, I tried to implement the music player in the as middle. Refer to the first line of code p303-307. First write the layout code. Three buttons are used to play, stop and pause

Finally, service is combined with audio playback to write a background music that can be played on the main interface: music will be available as soon as this interface is opened:

Development process learned by mail

This was useful in the last quiz.

If you still don't understand this article, you can refer to another related article:

Android plays background music through startservice

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>