App Intro Image Slider Android Studio Example

Hello, all. Welcome to app intro image slider android studio example.

If you want to give information about your app to a user, then intro slider is a good choice.

First check output of this app intro image slider android example then we will implement it.

Download Source Code

[sociallocker] Download Source Code [/sociallocker]

Creating app intro image slider android step by step

Step 1: Create a new project in Android Studio.

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

add following code into dependencies{} 

Step 3: Adding colors in colors.xml

Move to res->values->colors.xml directory and add following

Step 4: Opening new fragment in Android Studio

We need to create four new fragments.

To open new fragment in Android Studio, click on File tab which is present at the left top bar.

Now go to File->New->Fragment->Fragment(Blank) to create new fragment.

app intro image slider android

new_fragment

Create four fragments and give them name as

  1. IntroFragment_1
  2. IntroFragment_2
  3. IntroFragment_3
  4. IntroFragment_4

Step 5: Updating layout files of all fragments

Add following in fragment_intro_fragment_1.xml

Add following in fragment_intro_fragment_2.xml

Add following in fragment_intro_fragment_3.xml

Add following in fragment_intro_fragment_4.xml

Step 6: Create PreferenceHelper.java class

Create new class named PreferenceHelper.java

This class is used to implement Shared Preference

If you want to save preference then use putIntro() method

If you want to get saved preference then use getIntro() method

We will use both methods later.

Step 7: Creating WelcomeActivity

Create new activity named WelcomeActivity.

Check step 6 of scan barcode android example to know how to create 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 MainActivity.java

Step 10: Description of MainActivity

We do not need activity_main.xml because four fragments will replace it so comment it like below.

Following source code will move app to full-screen mode

When user click on Done, following will be executed

When user click on Skip, following will be executed

So all for app intro image 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...

7 Responses

  1. Alexxs says:

    Hola Hardik Parsania muy buenos videos de felicito, disculpa soy nuevo en esto como podría hacer para que este intro slider solo apareciera la primera vez que se abre la aplicación y ya para las siguientes ocaciones que se ocupe la app solo se abra y aparezca un Splash y entre a la app.
    Espero me puedas ayudar.
    Gracias

  2. Alexxs says:

    Hello Hardik Parsania very good congratulations videos, I’m sorry I’m new to this as I could do to make this intro slider only appear the first time the application is opened and for the following ocations that occupy the app only open and appear a Splash And enter the app.
    I hope you can help me.
    Thank you

    • Hardik Parsania says:

      You can use Shared Preference for this. When app is opened first time, save NO to sharedpreference. Use condition that if there is NO then enter directly into app otherwise enter into app intro activity.

  3. Savio Burrows says:

    Hi Hardik, thanks for the tutorial it was very help. I have a problem, I did everythng exactly but after I run the app it opens and shuts immediatly no error dialog box appears. Just after running it open n shuts. I cannot understand which part I have done wrong. Please advice.

    • Hardik Parsania says:

      Hi,
      Please check your logcat.
      If app is crashing then it should show an error for that crash.
      Copy your error here, we will sort out it.

  4. mitra says:

    Hi and thanks for this helpful tutorial. I did exactly what steps said but this error appears:
    FATAL EXCEPTION: main
    java.lang.RuntimeException: [email protected] must implement OnFragmentInteractionListener

Leave a Reply

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