free code source videoPlayer 2021

Video Player - All format HD Video Player

Operating System :

In this tutorial we will try to create Video Player – All format HD Video Player using Android. This simple application can be use in viewing some videos. The android is an open source operating system it’s free and user friendly to mobile developers. Android is available to any devices such as TV, phones, watches etc. So now let’s do the coding…..


Getting Started:

First you will have to download & install the Android Development IDE (Android Studio or Eclipse). Android Studio is an open source development feel free to develop your things. Here’s the link for the Android Studio

Layout Design

  • We will now create the design for the application, first locate the layout file called activity_main.xml, this is the default name when create a new activity. Then write these codes inside your layout file.
  1. <?xml version=“1.0” encoding=“utf-8”?>
  2. <RelativeLayout xmlns:android=“”
  3. xmlns:app=“”
  4. xmlns:tools=“”
  5. android:layout_width=“match_parent”
  6. android:layout_height=“match_parent”
  7. tools:context=“com.razormist.simplevideoplayer.MainActivity”>
  9. <VideoView
  10. android:id=“@+id/vv_display”
  11. android:layout_width=“wrap_content”
  12. android:layout_height=“280dp”
  13. android:layout_centerInParent=“true”/>
  14. </RelativeLayout>

Video Player - All format HD Video Player

Android Manifest File .


The Android Manifest file provides essential information about your app to the Android system in which the system must required before running the code. It describe the overall information about the application. It contains some libraries that needed to access the several method within the app.


free code source videoPlayer 2021

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android=""
  3. package="com.razormist.simplevideoplayer">
  5. <application
  6. android:allowBackup="true"
  7. android:icon="@mipmap/ic_launcher"
  8. android:label="@string/app_name"
  9. android:roundIcon="@mipmap/ic_launcher_round"
  10. android:supportsRtl="true"
  11. android:theme="@style/AppTheme">
  12. <activity android:name=".MainActivity"
  13. android:configChanges="orientation"
  14. android:screenOrientation="portrait">
  15. <intent-filter>
  16. <action android:name="android.intent.action.MAIN" />
  18. <category android:name="android.intent.category.LAUNCHER" />
  19. </intent-filter>
  20. </activity>
  21. </application>
  22. </manifest>


The Main Function

This code contains the main function of the application. This code will try to render the video file to display. To start with first locate your MainActivity java file and open it, then write this variable inside the MainActivity class.

  1. VideoView vv_display;

free code source videoPlayer 2021

Finally, configure the required methods inside the onCreate method for running the app.

vv_display = (VideoView) findViewById (;
String Path = “android.resource: //” + getPackageName () + “/” +;
Uri uri = Uri.parse (path);
vv_display.setVideoURI (uri),

MediaController mediaController = new MediaController (this);
vv_display.setMediaController (mediaController);
mediaController.setAnchorView (vv_display);
Try running the app and see if it works. There you have it, we have created a simple video player with Android. Hope this tutorial helped you what you are looking for. For more updates and tutorials just visit this site. Enjoy programming !!!

You have to wait 30 seconds.

Generating Download Link...
You have to wait 30 seconds.

Generating Download Link...

2 thoughts on “free code source videoPlayer 2021”

Comments are closed.