Audio playback I

1、 Simple audio playback

[project preparation]

① A video file. The location of the video file -- > create a new folder row under res -- > put the video into the row folder

② Generally, audio playback does not need to stay in the interface all the time, so audio playback should be placed in the service. Even if the interface is recycled, it will be played all the time.

[project structure]

[interface code]

【MainActivity.class】

[service code]

[prompt] when creating a service, you can register through the following methods, otherwise the service needs to be registered

【AndroidManifest.xml】

[effect] after clicking, the synthesizer will move

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
分享
二维码
< <上一篇
下一篇>>