Where to put the Video file in android Project
You can Create a folder under Resources and Name it raw. Then to provide the Path to the Video you can simply do
String path = "android.resource://" + getPackageName() + "/"
+ R.raw.intro_land;
and then
videoplayer.setVideoURI(Uri.parse(path));
You can create asset folder inside your project and store your video in that folder.
Then you can get that using getAssets()
function which is provided by Android
.
EDIT 1:
You can click on the Project window, press Alt-Insert, and select Folder -> Assets Folder. Android Studio will add it automatically to the correct location.
Also, you can do this.
VideoView view = (VideoView)findViewById(R.id.videoView);
String path = "android.resource://" + getPackageName() + "/" + R.raw.video_file;
view.setVideoURI(Uri.parse(path));
view.start();
Where video_file
is your file name.