MediaPlayer class can be used to play Audio in ANDROID.
See how to do this.

MediaPlayer mp = new MediaPlayer();
mp = MediaPlayer.create(MyClassName.this,songId);
		try {

		} catch (IllegalStateException e) {
		} catch (Exception e) {
			Toast.makeText(Switch.this,e.getMessage() , Toast.LENGTH_SHORT).show();			}

        //Called when the song completes.....
            mp.setOnCompletionListener(new OnCompletionListener() {
  			public void onCompletion(MediaPlayer mp) {

Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.