Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Java Arrays
  • Java Strings
  • Java OOPs
  • Java Collection
  • Java 8 Tutorial
  • Java Multithreading
  • Java Exception Handling
  • Java Programs
  • Java Project
  • Java Collections Interview
  • Java Interview Questions
  • Java MCQs
  • Spring
  • Spring MVC
  • Spring Boot
  • Hibernate
Open In App
Next Article:
How to Create a Dice Roller App in Android?
Next article icon

How to Create a Basic Intro Slider of an Android App?

Last Updated : 26 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

When we download any app and use that app for the very first time. Then we will get to see the intro slider inside our app. With the help of this slider, we educate our users on how they can use that app and it tells in detail about the app. In this article, we will take a look at the implementation of Intro Slider inside our app. Now, let's move towards the implementation of this feature in our app. 

What we are going to build in this article? 

We will be building a simple application in which we will be adding an intro slider that will tell about the different courses which are available on GeeksforGeeks. A sample GIF is given below to get an idea about what we are going to do in this article. Note that we are going to implement this project using the Java language. 


Step by Step Implementation of Intro Slider

Step 1: Create a New Project

To create a new project in Android Studio please refer to How to Create/Start a New Project in Android Studio. Note that select Java as the programming language.

Step 2: Add dependency of Intro Slider in build.gradle file.

Navigate to the gradle scripts > build.gradle (app) file and add the below dependency to it in the dependencies section.

implementation 'com.github.AppIntro:AppIntro:6.0.0'

Now navigate to the Gradle Scripts > build.gradle file of (Project) and add below code inside the repositories section. 

allprojects {

   repositories {

       // add below line in repositories section

       maven { url 'https://jitpack.io' }

       google()

       jcenter()

        }

}

Step 3: Create a new Java class that will display the slides for our slider

For creating a new java class navigate to the app > java > your app's package name > Right-click on it and click on New > Java class and name it as IntroSlider. After creating this class add the below code to it. Comments are added inside the code to understand the code in more detail.

Java
import android.os.Bundle;  import androidx.core.content.ContextCompat;  import com.github.appintro.AppIntro; import com.github.appintro.AppIntroFragment;  public class IntroSlider extends AppIntro {      // we are calling on create method     // to generate the view for our java file.     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);          // below line is for adding the new slide to our app.         // we are creating a new instance and inside that         // we are adding the title, description, image and          // background color for our slide.         // below line is use for creating first slide         addSlide(AppIntroFragment.newInstance("C++", "C++ Self Paced Course",                 R.drawable.gfgimage, ContextCompat.getColor(getApplicationContext(), R.color.purple_200)));          // below line is for creating second slide.         addSlide(AppIntroFragment.newInstance("DSA", "Data Structures and Algorithms", R.drawable.gfgimage,                 ContextCompat.getColor(getApplicationContext(), R.color.purple_200)));          // below line is use to create third slide.         addSlide(AppIntroFragment.newInstance("Java", "Java Self Paced Course", R.drawable.gfgimage,                 ContextCompat.getColor(getApplicationContext(), R.color.purple_200)));     } } 

Step 4: Working with the AndroidManifest.xml file 

As we are creating a new activity for displaying our Intro Slider we are adding this activity to your AndroidManifest.xml file. Add the below lines to your AndroidManifest.xml file

<!--adding activity for our intro slider-->

<activity

           android:name=".IntroSlider"

           android:theme="@style/Theme.AppCompat.NoActionBar" />

Below is the complete code for the AndroidManifest.xml file.

XML
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.gtappdevelopers.firebaseapp">      <application         android:allowBackup="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:roundIcon="@mipmap/ic_launcher_round"         android:supportsRtl="true"         android:theme="@style/Theme.FirebaseApp">                <!--adding activity for our intro slider-->         <activity             android:name=".IntroSlider"             android:theme="@style/Theme.AppCompat.NoActionBar" />                <activity android:name=".MainActivity">             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                  <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>     </application>  </manifest> 

Step 5: Working with the MainActivity.java file

Go to the MainActivity.java file and refer to the following code. Below is the code for the MainActivity.java file. 

Java
import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity;  import android.content.Intent; import android.os.Bundle; import android.widget.GridView; import android.widget.Toast;  import java.util.ArrayList; import java.util.List;  public class MainActivity extends AppCompatActivity {      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);          Intent i =new Intent(getApplicationContext(),IntroSlider.class);         startActivity(i);      } } 

After adding this code now run your app and see the output of the app. 

Output:


Next Article
How to Create a Dice Roller App in Android?

C

chaitanyamunje
Improve
Article Tags :
  • Java
  • Technical Scripter
  • Android
  • Technical Scripter 2020
  • Android Projects
Practice Tags :
  • Java

Similar Reads

  • How to Create a Custom Intro Slider of an Android App?
    Intro Slider in many apps is mostly used to educate the users about the app, the features of the app, and the services that our app will provide to us. In this article, we will take a look at the implementation of Custom Intro Slider in our app. What we are going to build in this Article? We will be
    8 min read
  • How to Create a Basic Widget of an Android App?
    Widgets are the micro-version of the application that consists of some functionality of the application that is displayed only on the Home Screens or the Lock Screen. For example, we see Weather, Time, and Google Search Bars on the Home Screen, and FaceLock, and FingerprintLock on the Lock Screen, w
    5 min read
  • Create Custom Intro Slider of an Android App with Kotlin
    IntroSlider is seen in many android applications to display the introduction of the different screens within our application. This intro slider will display information about different features within the android application. In this article, we will take a look at How to Create a Custom Intro Slide
    8 min read
  • How to Create a Unlock Slide-Bar in Android?
    A SeekBar is an extension of ProgressBar that adds a draggable thumb. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys. SeekBar is a useful user interface element in Android that allows the selection of integer values using a natural user in
    5 min read
  • How to Create a Dice Roller App in Android?
    A dice roller application is a simple application that generates a random number between 1 and a specified maximum number, simulating the roll of a dice. The application is typically used by gamers or anyone who needs to roll a die but doesn't have physical dice available. To create the app, you nee
    2 min read
  • How to Create a Wallpaper App in Android Studio?
    Almost all Android devices are having a wallpaper set on their home screen. For setting this wallpaper to the screen many Android devices provides a Wallpaper Application where we can browse different types of wallpapers based on various categories. In this article we will look at, building a simila
    15+ min read
  • How to Add Widget of an Android Application?
    It's known that many of the android apps that have installed on the phone contain widgets. The most common examples are the Calendar and the Clock widget. So what are these Widgets? Widgets are just a mini-app that lives on the home screen and apart from small launcher icons that normally appear on
    8 min read
  • How to Draw Over Other Apps in Android?
    Sometimes we require our app to show some content on the main screen irrespective of the app running in the foreground, this process is known as drawing over other apps. There are many apps that use this functionality to provide maximum features with minimum screen coverage. This also enables the us
    7 min read
  • How to Create Buttons Inside a Widget in Android?
    PrerequisitesHow to Create a Basic Widget of an Android App?How to Create a Dynamic Widget of an Android App?A Widget is a mini version of an Application, that provides a ground for the user to navigate through it or use its features from the Home Screen or Lock Screen. Widgets contain elements acco
    4 min read
  • How to Create an Animated Splash Screen in Android?
    Prerequisites: How to Create a Splash Screen in Android using Kotlin? Android Splash Screen is the first screen visible to the user when the application’s launched. Splash Screen is the user's first experience with the application that's why it is considered to be one of the most vital screens in th
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences