I'm making an app, and I want to keep printing background music or something, but I don't know what to do.
android
First, create a folder called raw in the res folder and save the music file you want to print there. And
public class MusicActivity extends Activity{
@override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mp = MediaPlayer.create (this, R.raw.music file name);
mp.setLooping(true);
mp.start();
}
}
You can do it like this.
© 2024 OneMinuteCode. All rights reserved.