App Intro Animation Video Slider Android Studio Example

Hello and welcome to the app intro animation video slider android studio example.

This app intro animation video slider android tutorial guides you to show a slideshow of video to introduce the Android app.

First check the output of example then we will develop app intro animation video slider android step by step.

Download Source Code

Creating app intro animation video slider android step by step

Step 1: Create a new project in Android Studio.

Open fresh new android studio project. Select Main Activity as the empty activity to reduce complexity.

Step 2: Updating build.gradle(Module:app) file

add following code into dependencies{}

Step 3: Adding resource directory “raw” under “res” directory.

Now we need to create a raw directory, in which we will save our video.

Follow below steps

  • One left click on res directory at left menu side of the android studio.
  • One Right click on res directory, one menu will open.
  • From that menu, follow New-> Android resource directory
app intro animation video slider android

add raw

  • When you click on Android resource directory, one dialog will open.
  • In Directory name, give value as “raw.“
app intro animation video slider android

Naming raw

Now save your video in the raw directory.

We have added two videos in this. You can download them by clicking following link.

Step 4: Creating Layout resource for single slide

Create one layout resource file under layout directory and name it as swipe_fragment.xml

add following source code

Step 5: Preparing Adapter class for Viewpager

Open a new Java class and name it as SlidingImage_Adapter.java

Update Package Name

Look at the below line

It contains the package name of the app. You need to replace it with your app’s package name.

There are two lines where you need to update package name. If else loop is present in the adapter class, this is where package name is present.

Step 6: Create PreferenceHelper.java class

Create new class named PreferenceHelper.java

This class is used to implement Shared Preference

Step 7: Creating WelcomeActivity

Create new activity WelcomeActivity.

Check step 6 of scan barcode android example to know how to create a new activity in android studio.

Now put below code in WelcomeActivity.java class

Step 8: Updating activity_welcome.xml file

Add below source code in activity_welcome.xml

Step 9: Updating activity_main.xml file

Add below code in activity_main.xml file

Step 10: Updating MainActivity.java

Update MainActivity with following source code

Pay attention to the below method

This method will remove top and bottom navigation bars.

So that we can present the video slide in full screen.

So we are done for app intro animation video slider android studio programmatically example tutorial. Thank you.

Hardik Parsania

I am mobile app developer. I am always passionate about solving complex and real world problems.I have developed many apps with great interest and superior logical skills.

You may also like...

4 Responses

  1. Amal Alkronz says:

    there is a problem the two video is playing at same time, this is the problem of view pager how can I solve this problem

    • Hardik Parsania says:

      What problem are you facing?

      • Amal Alkronz says:

        the two videos are playing at the same time, also when move in slider manually its not stop playing the video

        • Amal Alkronz says:

          I am developing an social media app that playing posts as the story in snapchat or messenger , an activity playing list of video & images ,the image I view on screen for 10 sec and then automatically go to next also in playing video when completed go to next item (either image or video) but if I view Image an the next item is video the sound of video is appearing when viewing image and if I change the pager to next manually the video not stopping

Leave a Reply

Your email address will not be published. Required fields are marked *