Changes

Jump to: navigation, search

An Android Studio VideoView and MediaController Tutorial

20 bytes added, 18:41, 20 January 2015
no edit summary
Create a new project in Android Studio, entering VideoPlayer into the Application name field and ebookfrenzy.com as the Company Domain setting before clicking on the Next button.
On the form factors screen, enable the Phone and Tablet option and set the minimum SDK setting to API 8: Android 2.2 (Froyo). Continue to proceed through the screens, requesting the creation of a blank activity named VideoPlayerActivity with a corresponding layout named activity_video_playerand a menu resource file named menu_video_player.
== Designing the VideoPlayer Layout ==
The user interface for the main activity will simply consist solely of an instance of the VideoView class. Use the Project tool window to locate the VideoPlayer -> app -> src -> main -> res -> layout -> activity_video_player.xml file, double click on it and switch the Designer tool to Design mode. Delete the “Hello world!” TextView, switch to Text mode and remove the padding properties from the layout so that the XML reads as follows:
<pre>
[[Image:android_studio_videoviewandroid_studio_videoview2.png|A VideoView component added to an Android Studio Designer layout|]]
Figure 47-1

Navigation menu