Loading...

Android - Simple Video Player

View: 497    Dowload: 0   Comment: 0   Post by: daii   Category: Mobile applications   Fields: Game - Entertainment

Download  android-simple-video-player.zip (9.10 MB)

You need to Sign In to download the file android-simple-video-player.zip
If you do not have an account then Sign up for free here

In this tutorial we will try to create a Simple 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 https://developer.android.com/studio/index.html.

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="<a href="http://schemas.android.com/apk/res/android"
  3. " rel="nofollow">http://schemas.android.com/apk/res/android"
  4. </a> xmlns:app="<a href="http://schemas.android.com/apk/res-auto"
  5. " rel="nofollow">http://schemas.android.com/apk/res-auto"
  6. </a> xmlns:tools="<a href="http://schemas.android.com/tools"
  7. " rel="nofollow">http://schemas.android.com/tools"
  8. </a> android:layout_width="match_parent"
  9. android:layout_height="match_parent"
  10. tools:context="com.razormist.simplevideoplayer.MainActivity">
  11.  
  12. <VideoView
  13. android:id="@+id/vv_display"
  14. android:layout_width="wrap_content"
  15. android:layout_height="280dp"
  16. android:layout_centerInParent="true"/>
  17. </RelativeLayout>

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.

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

Finally, initialize the require methods inside the onCreate method to run the application.

  1. vv_display = (VideoView)findViewById(R.id.vv_display);
  2. String path = "android.resource://" + getPackageName() + "/" + R.raw.video;
  3. Uri uri = Uri.parse(path);
  4. vv_display.setVideoURI(uri);
  5.  
  6. MediaController mediaController = new MediaController(this);
  7. vv_display.setMediaController(mediaController);
  8. mediaController.setAnchorView(vv_display);

Try to run the app and see if it worked.

There you have it we have created a Simple Video Player using Android. I hope that this tutorial help you to what you are looking for. For more updates and tutorials just kindly visit this site. Enjoy Coding!!!

Android - Simple Video Player

Learn on how to create a Simple 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.

Posted on 27-04-2018 

Comment:

To comment you must be logged in members.

Files with category

  • Android - Simple Image Capture

    Android - Simple Image Capture

    View: 644    Download: 0   Comment: 0

    Category: Mobile applications     Fields: Game - Entertainment

    Learn on how to create a Simple Image Capture using Android. This simple application can be used to any system that needed the information about the location of the user. The android is an open source operating system it's free and user friendly to...

  • Android - Simple Video Player

    Android - Simple Video Player

    View: 497    Download: 0   Comment: 0

    Category: Mobile applications     Fields: Game - Entertainment

    Learn on how to create a Simple 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...

  • An Experience about Using Webview in Android Studio 3.0

    An Experience about Using Webview in Android Studio 3.0

    View: 285    Download: 0   Comment: 0

    Category: Android     Fields: Other

    I am blogging on ngocminhtran.com (using WordPress platform). Like most websites, I want to write an Android application to help viewers have a lot of great experiences with my blog.

  • Android - Simple Sending SMS

    Android - Simple Sending SMS

    View: 557    Download: 0   Comment: 0

    Category: Mobile applications     Fields: Game - Entertainment

    Learn on how to create a Simple Sending SMS using Android. This tutorial is only an example for sending an SMS, it does not contain the receiving message yet. Android is a mobile operating system developed by Google. It used in several gadget like...

  • Bomb Explode! (An Android App Strategy Game)

    Bomb Explode! (An Android App Strategy Game)

    View: 510    Download: 0   Comment: 0

    Category: Mobile applications     Fields: Game - Entertainment

    This android app named Bomb Explode! is a capstone project that I made for a particular school. BOMB EXPLODE! is a Human Versus Computer strategy game. The objective is to eliminate the opponent by blowing up their BOMBS. Each player takes a turn by...

  • GIS App for Flood-Prone and Disease Affected Areas

    GIS App for Flood-Prone and Disease Affected Areas

    View: 496    Download: 1   Comment: 0

    Category: Mobile applications     Fields: Game - Entertainment

    GIS App for Flood-Prone and Disease Affected Areas is one of the capstone project that I have created in a particular school. Features of the application: - Geographic Map - GIS - Flood Prone Map - Urban Map - Search a particular area - Has SQLite...

  • NSO Demographic Application

    NSO Demographic Application

    View: 541    Download: 0   Comment: 0

    Category: Mobile applications     Fields: Game - Entertainment

    This app is entitled NSO Demographic Application that was one of the capstone project/thesis project that I made for a particular school. This app features to provide a demographic survey of the National Statistics Office that will send to the...

  • HandEBook: An IT Portable Book Application

    HandEBook: An IT Portable Book Application

    View: 514    Download: 0   Comment: 0

    Category: Mobile applications     Fields: Game - Entertainment

    This is an android mobile application entitled HandEBook: An IT Portable Book Application was one one of the capstone project that I have made in our clients at Cotabato. We used the Basic4Android software for the frontend and SQLite for the database...

 
File suggestion for you
Loading...
File top downloads
Loading...
Loading...
Codetitle - library source code to share, download the file to the community
Copyright © 2018. All rights reserved. codetitle Develope by Vinagon .Ltd