Instantly share code, notes, and snippets.

What would you like to do?
Playing a video stored in your resources/raw directory
VideoView myVideo = (VideoView) rootView.findViewById(;
//Set video name (no extension)
String myVideoName = "my_video";
//Set app package
String myAppPackage = "com.myapp";
//Get video URI from raw directory
Uri myVideoUri = Uri.parse("android.resource://"+myAppPackage+"/raw/"+myVideoName);
//Set the video URI
//Play the video
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment