try this code.
resource is the name of the file you want to play, and one.two is the name of the package, the path of which may look like android.resource://package_name/raw/file_name
VideoView video=(VideoView) findViewById(R.id.videoview); MediaController mediaController = new MediaController(this); mediaController.setAnchorView(video); video.setMediaController(mediaController); //Uri uri = Uri.parse("android.resource://play.vedio/"+R.raw.dobeernotdrugs); video.setKeepScreenOn(true); video.setVideoPath("android.resource://one.two/raw/"+resource); video.start(); video.requestFocus();
Also check out this tutorial
source share