TextWriter in Android with Example Last Updated : 12 Sep, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report TextWriter is used to animate text. TextWriter can be used when users open the app i.e. in place of Splash Screen. One can also use Splash Screen instead of TextWriter but TextWriter is an animation library and it is known that animations help to gain the attention of the user so it is best to learn it. TextWriter can be customized according to the requirements like textColor, textSize, letterSpacing, and many more. Approach Step 1: Add the support library in the root build.gradle file (not in module build.gradle file). This library jitpack is a novel package repository. It is made for JVM so that any library which is present in github and bigbucket can be directly used in the application. XML allprojects { repositories { maven { url 'https://jitpack.io' } } } Step 2: Add the support Library in build.gradle file and add dependency in the dependencies section. XML implementation 'com.github.sarnavakonar:TextWriter:v1.0' Step 3: Add the following code in activity_main.xml file. In this file add the TextWriter to the layout. activity_main.xml <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <com.sarnava.textwriter.TextWriter android:id="@+id/textWriter" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:android="http://schemas.android.com/apk/res/android" /> </androidx.constraintlayout.widget.ConstraintLayout> Step 4: Add the following code in MainActivity.java file. In this file add important tags of TextWriter and also add a setListner() to it which will invoked automatically when TextWriter written the whole text. MainActivity.java package org.geeksforgeeks.textWriter import android.graphics.Color; import android.os.Bundle; import android.widget.Toast; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import com.sarnava.textwriter.TextWriter; public class Activity extends AppCompatActivity { TextWriter textWriter; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textWriter = findViewById(R.id.textWriter); textWriter // sets the width of the view .setWidth(8) // More the value of delay, // more time it will take to finish // duration is in milliseconds .setDelay(30) // set color of text .setColor(Color.GREEN) // sets the configuration/shape of the drawing // based on Configuration selected .setConfig(TextWriter.Configuration.INTERMEDIATE) // set size of text .setSizeFactor(30f) // set letter spacing of text .setLetterSpacing(15f) .setText("ALGORITHM GFG") // when writing is finished this // function will get invoked automaically. .setListener(new TextWriter.Listener() { @Override public void WritingFinished() { Toast.makeText(Activity.this, "Learn Algorithm!", Toast.LENGTH_SHORT).show(); } }) .startAnimation(); } } Output: Run on Emulator Comment More infoAdvertise with us Next Article TextWriter in Android with Example M madhavmaheshwarimm20 Follow Improve Article Tags : Android Android-Animation Similar Reads Android Architecture Android architecture contains a different number of components to support any Android device's needs. Android software contains an open-source Linux Kernel having a collection of a number of C/C++ libraries which are exposed through application framework services. Among all the components Linux Kern 5 min read Android Tutorial In this Android Tutorial, we cover both basic and advanced concepts. So whether you are a fresher (graduate) or an experienced candidate with several years of Android Development experience, you can follow this Android tutorial to kick-start your journey in Android app development. Our Android Tutor 15+ min read Activity Lifecycle in Android with Demo App In Android, an activity is referred to as one screen in an application. It is very similar to a single window of any desktop application. An Android app consists of one or more screens or activities. Each activity goes through various stages or a lifecycle and is managed by activity stacks. So when 9 min read Introduction to Android Development Android operating system is the largest installed base among various mobile platforms across the globe. Hundreds of millions of mobile devices are powered by Android in more than 190 countries of the world. It conquered around 71% of the global market share by the end of 2021, and this trend is grow 5 min read Top 50 Android Interview Questions and Answers - SDE I to SDE III A Linux-based open-source OS, Android was created by Andy Rubin and became one of the most popular smartphone operating systems. With 71 percent of the market share worldwide, Android is on top. Because it is on top in the smartphone OS, Android development is always in demand.If you are seeking a j 15+ min read Android UI Layouts Layouts in Android define the user interface and hold UI controls or widgets that appear on the screen of an application. Every Android application consists of View and ViewGroup elements. Since an application contains multiple activitiesâeach representing a separate screenâevery activity has multip 5 min read Top 50 Flutter Interview Questions and Answers for 2025 Flutter is an open-source, cross-platform application development framework. It was developed by Google in 2017. It is used to build applications for Android, iOS, Linux, Mac, Windows, and the web. Flutter uses the Dart programming language. It provides a simple, powerful, efficient, and easy-to-und 15+ min read Components of an Android Application There are some necessary building blocks that an Android application consists of. These loosely coupled components are bound by the application manifest file which contains the description of each component and how they interact. The manifest file also contains the appâs metadata, its hardware confi 3 min read Android Studio Tutorial It is stated that "If you give me six hours to chop down a tree then I will spend the first four hours in sharpening the axe". So in the Android Development World if we consider Android Development as the tree then Android Studio should be the axe. Yes, if you are starting Android Development then y 9 min read MVVM (Model View ViewModel) Architecture Pattern in Android Developers always prefer clean and structured code for projects. Organizing the codes according to a design pattern helps in the maintenance of the software. By having knowledge of all crucial logic parts of the android application, it is easier to add and remove app features. Further, design patter 8 min read Like