Skip to content
Related Articles
Open in App
Not now

Related Articles

Implementation of WhatsNew Library in Android

Improve Article
Save Article
  • Last Updated : 15 May, 2021
Improve Article
Save Article

In this article, we are going to show the important content of the app using the WhatsNew library. It can be simply thought of like showing some information like notification, instruction, faq, or terms and conditions like things. 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

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 and mavenCentral() Repository

Navigate to the Gradle Scripts > build.gradle(Module:app) and add the below dependency in the dependencies section.   

implementation ‘io.github.tonnyl:whatsnew:0.1.7’

Add the mavenCentral() repository to your build file. Add it to your root build.gradle at the end of repositories inside the allprojects{ } section.

allprojects {

 repositories {





After adding this dependency sync your project and now we will move towards its implementation.  

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"?>
        android:text="Whats New" />

Step 4: Working with the file

Go to the file and refer to the following code. 

// This is what we are using to show our data
new WhatsNewItem(“Firebase Authentication”, “Firebase Authentication service provides easy to use UI libraries and SDKs to authenticate users to your app.”,,

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 android.view.View;
import android.widget.Button;
import io.github.tonnyl.whatsnew.WhatsNew;
import io.github.tonnyl.whatsnew.item.WhatsNewItem;
import io.github.tonnyl.whatsnew.util.PresentationOption;
public class MainActivity extends AppCompatActivity {
    Button button;
    protected void onCreate(Bundle savedInstanceState) {
        // initialising layout
        button = findViewById(;
        // click on button
        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                // creating a new Instance for 
                // showing Content using WhatsNew
                WhatsNew whatsNew = WhatsNew.newInstance(
                        // add as much item you want with 
                        // item title, description and image
                        new WhatsNewItem("Firebase Authentication", "Firebase Authentication service provides easy to use UI libraries and SDKs to authenticate users to your app.",,
                        new WhatsNewItem("Firebase Realtime Database", "The Firebase Realtime Database is a cloud based NoSQL database ",,
                        new WhatsNewItem("Cloud Firestore", " The cloud Firestore is a NoSQL document database that provides services like store, sync, and query through the application on a global scale",,
                        new WhatsNewItem("Firebase", " irebase is a product of Google which helps developers to build, manage, and grow their apps easily. It helps developers to build their apps faster and in a more secure way.", WhatsNewItem.NO_IMAGE_RES_ID)
                // on click present this layout


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!