title: Android-Media Player
body: <p>I am new to android. I am trying to play a video from sdcard.</p>
  
  <p>this is the sample code I have used:</p>
  
  <pre><code>  public class videoa extends Activity {
    /** Called when the activity is first created. */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.main);
  
        VideoView videoView = (VideoView)this.findViewById(R.id.videoView);
        MediaController mc = new MediaController(this);
        videoView.setMediaController(mc);
        // (1) Web
        //videoView.setVideoURI(Uri.parse(
        //"http://www.bogotobogo.com/Video/sample.3gp"));
        //"http://www.bogotobogo.com/Video/sample.mp4"));
        //"http://www.bogotobogo.com/Video/sample.mov"));
  
        /* (2) SD card */
        //videoView.setVideoPath("/sdcard/sample.3gp");
        videoView.setVideoPath("/sdcard/robot.avi");
        //videoView.setVideoPath("/sdcard/sample.mov");
        // videoView.setVideoURI(Uri.parse(
          //"file:///sdcard/sample.mov"));
  
        videoView.requestFocus();
        videoView.start();
    }
  }
  </code></pre>
  
  <p>I have launched manually And set the target as <code>-sdcard C:/android-sdk-windows/tools/sdcard.img</code>.</p>
  
  <p>When i have launched the emulator it shows <code>Video Cannot be Displayed</code>.</p>
  
  <p>Please help me out.</p>