VOOZH about

URL: https://www.geeksforgeeks.org/android/how-to-implement-circular-progressbar-in-android/

⇱ How to Implement Circular ProgressBar in Android? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Implement Circular ProgressBar in Android?

Last Updated : 23 Jul, 2025

ProgressBar is used when we are fetching some data from another source and it takes time, so for the user's satisfaction, we generally display the progress of the task. In this article, we are going to learn how to implement the circular progress bar in an Android application using Java. So, this article will give you a complete idea of implementing a circular progress bar in an application built in Android Studio. So, without wasting further time let’s go to the article and read how we can achieve this task.

What we are going to develop in this article?

We will be building a simple application in which we will be implementing a circular progress bar with a text display. A sample video 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 both using the Java and Kotlin languages. But there are 2 Methods:

We will be implementing something like this GIF


Method-1 (Using Custom Drawables to Create the Circular Layout and Indicator):

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 you can select Java as well as Kotlin as the programming language.

Step 2: Create circular_progress_bar.xml

Navigate to the app > res > drawable> right-click and select new > drawable resource file and name the new XML file as circular_progress_bar.xml and refer to the following code. Comments are added inside the code to understand the code in more detail.


Step 3: Create circular_shape.xml

Similarly, create a new drawable resource file and name the file as circular_shape.xml and refer to the following code.


Step 4: Working with the activity_main.xml file

Now it’s time to design the layout of the application. So for that, navigate to the app > res > layout > activity_main.xml and refer to the code written below. 

Step 5: Working with the MainActivity file

Navigate to app > java > your app's package name > MainActivity file and add the below code to it. Comments are added in the code to get to know in detail.


That’s all, now the application is ready to install on the device. Here is what the output of the application looks like.

Output Method 1:


Method-2 (Using Material Component's CircularProgressIndicator):

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 you can select Java as well as Kotlin as the programming language.

Step 2: Working with the activity_main.xml :

Now we will design the layout of the application. So for that, navigate to the app > res > layout > activity_main.xml and refer to the code written below. 

Here we will be using Material component's CircularProgressIndicator


Step 3: Working with the MainActivity file

Navigate to app > java > your app's package name > MainActivity file and add the below code to it. Comments are added in the code to get to know in detail.


Output Method 2:



Comment
Article Tags:
Article Tags:

Explore