Progress bar is necessary in every project to create a loading menu and give info to user for waiting loading their content. Here is some code for developers to create progress bar. this code use their as they(developer) want.

Horizontal progress bar code

 ProgressBar tp = new ProgressBar(this,null, android.R.attr.progressBarStyleHorizontal); linear1.addView(tp,700,30); tp.setIndeterminate(true);

Circle progress bar code

ProgressBar msg = new ProgressBar(MainActivity.this);  linear1.addView(msg);

Create progress bar in dialog box

 final ProgressDialog prog = new ProgressDialog(MainActivity.this);prog.setMax(100);prog.setTitle("Hello");prog.setMessage("Message");prog.setIndeterminate(true);prog.setCancelable(false);;

Show progress bar in dialog box

 final ProgressDialog prog = new ProgressDialog(MainActivity.this); prog.setMax(100); prog.setTitle("Your Title"); prog.setMessage("Your Message"); prog.setIndeterminate(true); prog.setCanceledOnTouchOutside(false);;

This code also can used for sketchwere. add sdd source directly block and past the code.