Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

How to Create an Onboarding Screen in Android?

  • Last Updated : 11 Jul, 2021

Hello geeks, today we are going to learn that how we can add Onboarding Screen to our android application in the android studio so that we can provide a better user experience to the user of the application.

What is Onboarding Screen?

The onboarding screen can be understood as a virtual unboxing of an application. Users go through a series of screens which finally directs users to the application interface. Goals or purposes of Onboarding screen:

Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more,  please refer Complete Interview Preparation Course.

  • Welcomes user and excite them about application ahead.
  • Tell the features or functions of the application.
  • Allow users to register or log in.
  • Collect information about the interests of the user(for example – when we open the Spotify application for the first time it asks the user to select singers which he/she likes).

What we are going to build in this article?

Here is the sample video of the onboarding screen which we are going to create in this article. Note that we are going to implement this project using the Java language. 

Step by Step Implementation

Step 1: Create a new project

  • Open a new project.
  • We will be working on Empty Activity with language as Java. Leave all other options unchanged.
  • You can change the name of the project at your convenience.
  • There will be two default files named activity_main.xml and

If you don’t know how to create a new project in Android Studio then you can refer to How to Create/Start a New Project in Android Studio?  

Step 2: Navigate to Build scripts -> build.gradle(module) file and add the following dependency in it

implementation 'com.ramotion.paperonboarding:paper-onboarding:1.1.3'

After adding this dependency click on sync now to save all the changes.

Step 3: Working with the activity_main.xml file

Navigate to the app > res > layout > activity_main.xml and add the below code to that file. Below is the code for the activity_main.xml file. 


<?xml version="1.0" encoding="utf-8"?>
<!-- Here frame layout is used so that different 
     fragments of our onboarding screen can be
     changed within the same layout-->

Step 4: Working with the file

Go to the file and refer to the following code. Below is the code for the file. Comments are added inside the code to understand the code in more detail.


import android.os.Bundle;
import com.ramotion.paperonboarding.PaperOnboardingFragment;
import com.ramotion.paperonboarding.PaperOnboardingPage;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
    private FragmentManager fragmentManager;
    protected void onCreate(Bundle savedInstanceState) {
        fragmentManager = getSupportFragmentManager();
        // new instance is created and data is took from an 
        // array list known as getDataonborading
        final PaperOnboardingFragment paperOnboardingFragment = PaperOnboardingFragment.newInstance(getDataforOnboarding());
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        // fragmentTransaction method is used
        // do all the transactions or changes
        // between different fragments
        fragmentTransaction.add(, paperOnboardingFragment);
        // all the changes are committed
    private ArrayList<PaperOnboardingPage> getDataforOnboarding() {
        // the first string is to show the main title ,
        // second is to show the message below the
        // title, then color of background is passed ,
        // then the image to show on the screen is passed
        // and at last icon to navigate from one screen to other
        PaperOnboardingPage source = new PaperOnboardingPage("Gfg", "Welcome to GeeksForGeeks", Color.parseColor("#ffb174"),R.drawable.gfgimg,;
        PaperOnboardingPage source1 = new PaperOnboardingPage("Practice", "Practice questions from all topics", Color.parseColor("#22eaaa"),R.drawable.practice_gfg,;
        PaperOnboardingPage source2 = new PaperOnboardingPage("", " ", Color.parseColor("#ee5a5a"),R.drawable.gfg_contribute, R.drawable.contribution);
        // array list is used to store
        // data of onbaording screen
        ArrayList<PaperOnboardingPage> elements = new ArrayList<>();
        // all the sources(data to show on screens)
        // are added to array list
        return elements;

Congratulations, we have successfully made the Onboarding screen for our application. The final output is shown below.


My Personal Notes arrow_drop_up
Recommended Articles
Page :