title: browsing and playing audio and video files in android
body: <p>I am developing a project in which i need to play Audio and Video files. When audio player is clicked i should display only audio files from sdcard and play those files.</p>
  
  <p>When video player is clicked i only need to display video files and play those video files.</p>
  
  <p>I am using media player for playing the files.</p>
  
  <pre><code> MediaPlayer mp = new MediaPlayer();
   String filepath = Environment.getExternalStorageDirectory()+"/f.mp3";
   mp.setDataSource(filepath);
   mp.start();
  </code></pre>
  
  <p>But My problem is,how to browse the audio/video files and set the data source dynamically when the user selects a particular file. </p>