When I only run the java file it produces sound. I now want on button click to call the java file and produce the sound in eclipse.
Here is my Java code:
import org.jfugue.player.Player;
public class HelloWorld {
public static void main(String[] args) {
Player player = new Player();
player.play("C D E F G A B");
}
}
And my MainActivity.java
in eclipse:
public class MainActivity extends ActionBarActivity implements View.OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button1 = (Button)findViewById(R.id.button1);
button1.setOnClickListener((OnClickListener) this);
}
@Override
public void onClick(View arg0) {
// CODE HERE???
}
}