0% found this document useful (0 votes)
151 views2 pages

Circular Progress Bar in Android

This document describes a program to implement a circular progress bar in Android. The program displays a progress bar using a ProgressDialog and updates the progress at regular intervals using a Timer and TimerTask. The activity_main.xml layout contains a button and MainActivity.java handles the button click to show the progress dialog, set its properties like style, max value, and updates the progress from 0-100 over time.

Uploaded by

Ajinkya Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
151 views2 pages

Circular Progress Bar in Android

This document describes a program to implement a circular progress bar in Android. The program displays a progress bar using a ProgressDialog and updates the progress at regular intervals using a Timer and TimerTask. The activity_main.xml layout contains a button and MainActivity.java handles the button click to show the progress dialog, set its properties like style, max value, and updates the progress from 0-100 over time.

Uploaded by

Ajinkya Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
  • Practical No. 13: Develop a Program to Implement Progress Bar
  • Application Output

Practical No. 13 : Develop a program to implement Progress Bar.

Name: Ajinkya P. Patil Class: TYCM-II Roll No.: 39

1. Write a program to display circular progress bar.

activity_main.xml Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="[Link] <Button
pk/res/android" android:id="@+id/b1"
android:layout_width="wrap_content"
xmlns:app="[Link]
es-auto" android:layout_height="wrap_content"
android:gravity="center"
xmlns:tools="[Link] android:layout_weight="1"
ls" android:text="Button" />
android:layout_width="match_parent" </LinearLayout>
android:layout_height="match_parent"
tools:context=".MainActivity">

[Link] Code:

package [Link].practical_11; [Link](ProgressDialog.STYLE_HO


package [Link].pr13_2; RIZONTAL);
[Link](100);
import [Link](false);
[Link]; [Link]("Android
Developers");
import [Link]; [Link]("Dowloading
import [Link]; File");
import [Link]; [Link]();
import [Link]; Timer t = new Timer();
TimerTask tsk = new
import [Link]; TimerTask() {
import [Link]; @Override
public void run() {
public class MainActivity extends couter++;
AppCompatActivity {
[Link](couter);
Button b1; if(couter == 100)
ProgressDialog pd; {
int couter = 0 , max; [Link]();
}
@Override }
protected void onCreate(Bundle };
savedInstanceState) { [Link](tsk,0,100);
[Link](savedInstanceState);
}
setContentView([Link].activity_main); });
b1 = findViewById([Link].b1);
[Link](new
[Link]() {
@Override
public void onClick(View v) { }
pd = new
ProgressDialog([Link]); }
Output:

Practical No. 13 : Develop a program to implement Progress Bar. 
Name: Ajinkya P. Patil   
 
   Class: TYCM-II 
 
 
    Roll
Output:

You might also like