Dots Loading Android Using Android Studio


In this article, we are going to see how to create a Dot Loader in Android app using the Android Studio. In a user interface, the Dot Loader plays a unique role. It is the only thing on a Splash page which will attract the user. We can define different levels of motions to the Dots.

Step 1

Create a new project in Android Studio.


Give a name to the project and click "Next".

Select "Phone and Tablet" and click "Next".


Select an empty activity and click "Next".


At last, give the activity name and click on "Finish".


Step 2

Set up the gradle by just locating the Gradle Scripts>>Build.Gradle.


And type the following dependency in your app's build.gradle.


Code copy is given below.
  1. compile 'com.steelkiwi:dots-loader-view:1.0.0'  
Step 3

Next, go to app >> res >> layout >> activity_main.xml. Select activity page.


And just type the code as given below.


Code copy is mentioned below.
  1. <  
  2.         android:id="@+id/dotsLoader"  
  3.         android:visibility="visible"  
  4.         android:layout_width="match_parent"  
  5.         android:layout_height="match_parent"  
  6.         app:dlv_item_drawable="@drawable/circle_background"  
  7.         app:dlv_line_color="@color/point_color"  
  8.         />  
Step 4

 Next, go to app >> java>> Select Mainactivity page.


And just type the code as given.


  1. DotsLoaderView dotsLoaderView;  
  2. @Override  
  3. protected void onCreate(Bundle savedInstanceState) {  
  4.     super.onCreate(savedInstanceState);  
  5.     setContentView(R.layout.activity_main);  
  7.     dotsLoaderView = (DotsLoaderView)findViewById(;  
  9.     downloadDemo();  
  10. }  
  12. private void downloadDemo() {  
  13.     AsyncTask<String,String,String> demoAsync = new AsyncTask<String, String, String>() {  
  15.         @Override  
  16.         protected void onPreExecute() {  
  17.   ;  
  18.         }  
  20.         @Override  
  21.         protected String doInBackground(String... params) {  
  22.             try {  
  23.                 Thread.sleep(5000);  
  24.             } catch (InterruptedException e) {  
  25.                 e.printStackTrace();  
  26.             }  
  27.             return "done";  
  28.         }  
  30.         @Override  
  31.         protected void onPostExecute(String s){  
  32.             if(s.equals("done"))  
  33.                 dotsLoaderView.hide();  
  34.         }  
  35.     };  
  36.     demoAsync.execute();  
Step 5

After step 4, sync all the dependency gradles and resource files by clicking the Sync button on the top right corner of the gradle page.


Step 6

Verify the preview.

After the code is applied, the preview will appear like this.


Step 7

Next, go to Android Studio and deploy the application. Select an emulator or your Android mobile with USB debugging enabled. Give it a few seconds to make installations and set permissions.


Run the application in your desired emulator (Shift + F10).


Explanation of source code

The source code provided in this article is just the dependencies of motions and the code used in activity_main.xml will make the dots move and define its attributes.


In this article, we created the app named Dots Loader, then we have inserted a Gradle and we learned how to give motion to the dot and finally, we have deployed that as an output.

*Support and Share; Thank You*


Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now