A friend of mine asked me to write a simple single sound soundboard for him. I put the basics together and got it running in the emulator with little to no trouble at all. However when I install the app onto my Droid Eris I get no audio playback. I get no errors and the app seems to function fine, just can't hear anything from it. I checked the volume on my phone and even turned it up all the way.
Here's the source:
Using java Syntax Highlighting
- package montypython.ping;
- import android.app.Activity;
- import android.os.Bundle;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.media.MediaPlayer;
- public class Ping extends Activity implements OnClickListener {
- private MediaPlayer mp;
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- mp = MediaPlayer.create(Ping.this, R.raw.ping);
- View btnPing = findViewById(R.id.btnPing);
- btnPing.setOnClickListener(this);
- }
- public void onClick(View v) {
- switch (v.getId()) {
- case R.id.btnPing:
- mp.seekTo(0);
- mp.start();
- break;
- }
- }
- }
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
Do I need to set the volume for MediaPlayer separately or something like that? Again this works perfectly fine from the emulator within Eclipse.
Any help or pointer in the right direction would greatly be appreciated.
Thanks,
-Terrormaster





