71.3 Creating the Video Playback Example
The remainder of this chapter will create an example application intended to use the VideoView and MediaController classes to play an MPEG-4 video file.
Select the Create New Project quick start option from the welcome screen and, within the resulting new project dialog, choose the Empty Activity template before clicking on the Next button.
Enter VideoPlayer into the Name field and specify com.ebookfrenzy.videoplayer as the package name. Before clicking on the Finish button, change the Minimum API level setting to API 26: Android 8.0 (Oreo) and the Language menu to Java.
Designing the VideoPlayer Layout
The user interface for the main activity will consist solely of an instance of the VideoView class. Use the Project tool window to locate the app -> res -> layout -> activity_main.xml file, double-click on it, switch the Layout Editor tool to Design mode and delete the default TextView widget.
From the Widgets category...