I'm a noob in Android Studio and I created a Soundboard with over 300 Sounds. Is there a way to upload the Sounds in the Firebase and then play them out of the Firebase?
Here is the Code with only 2 Sounds. Just to show how my Soundboard works.
public class MainActivity extends AppCompatActivity{
public MediaPlayer mp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
//plays sound
public void sound1(View view){
cleanUpMediaPlayer();
mp = MediaPlayer.create(this, R.raw.sound1);
mp.start();
}
public void sound2(View view){
cleanUpMediaPlayer();
mp = MediaPlayer.create(this, R.raw.sound2);
mp.start();
}
public void cleanUpMediaPlayer(){
if(mp != null) {
if(mp.isPlaying()) {
try{
mp.reset();
mp.prepare();
mp.stop();
mp.release();
mp = null;
}catch (Exception e){
e.printStackTrace();
}
}
}
}}
And this with 300 sounds.
Can you explain me how to put the sounds in the Firebase (if this is possible at all) and how to play them out of the Firebase?
Sorry for my bad experience and my English :)