Jump to content

TextBin Online

TextBin is a website where you can store any text online for easy sharing.
Buy now
  • News ticker sample
  • News ticker sample

Mp3 Java Android Code

Recommended Posts

package com.example.audiomediaplayer1;  


import android.media.MediaPlayer;  

import android.net.Uri;  

import android.os.Bundle;  

import android.app.Activity;  

import android.view.Menu;  

import android.widget.MediaController;  

import android.widget.VideoView;  


public class MainActivity extends Activity {  



    protected void onCreate(Bundle savedInstanceState) {  




        MediaPlayer mp=new MediaPlayer();  


            mp.setDataSource("/sdcard/Music/maine.mp3");//Write your location here  




        }catch(Exception e){e.printStackTrace();}  





    public boolean onCreateOptionsMenu(Menu menu) {  

        // Inflate the menu; this adds items to the action bar if it is present.  

        getMenuInflater().inflate(R.menu.activity_main, menu);  

        return true;  




Share this post

Link to post
Share on other sites
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

General Chat

General Chat

Please enter your display name

  • Create New...