2. UI controls
• Input controls are the interactive components in your app's user
interface.
• Android provides a wide variety of controls you can use in
your UI, such as buttons, text fields, seek bars, check box,
zoom buttons, toggle buttons, and many more.
2
6. TextView
• A TextView displays text to the user and optionally allows
them to edit it.
• A TextView is a complete text editor, however the basic class
is configured to not allow editing.
6
11. android:autoText If set, specifies that this Text View has
a textual input method and
automatically corrects some common
spelling errors.
android:text This is the Text to display.
android:editable If set, specifies that this Text View has
an input method.
android:visibility This controls the initial visibility of the
view.
11
30. Progress bars
• Progress bars are used to show progress of a task.
• For example, when you are uploading or downloading something from
the internet, it is better to show the progress of download/upload to the
user.
• In android there is a class called ProgressDialog that allows you to create
progress bar. In order to do this, you need to instantiate an object of this
class.
Its syntax is.
ProgressDialog progress = new progressDialog(this);
30
33. Time Picker
• Android Time Picker allows you to select the time of day in
either 24 hour or AM/PM mode.
• The time consists of hours, minutes and clock format.
33
34. • In order to use TimePicker class, you have to first define the
TimePicker component in your activity.xml. It is define as below −
34
36. Datetime picker
• Android Date Picker allows you to select the date consisting of
day, month and year in your custom user interface.
• For this functionality android provides DatePicker and
DatePickerDialog components.
36
37. • On calling this showDialog method, another method called
onCreateDialog gets automatically called. So we have to override
that method too. Its syntax is given below
In the last step, you have to register the DatePickerDialog listener and override
its onDateSet method. This onDateSet method contains the updated day, month
and year. Its syntax is given below
37
38. private DatePickerDialog.OnDateSetListener myDateListener = new
DatePickerDialog.OnDateSetListener()
{
@Override
public void onDateSet(DatePicker arg0, int arg1, int arg2, int arg3) { // arg1 = year
// arg2 = month // arg3 = day
}
};
38
42. INTENT
• An intent is an abstract description of an operation to be
performed.
• It can be used with startActivity to launch an Activity.
42
43. Calling built-in applications
• One of the key aspects of android is using intents to call
activities from other applications.
• Eg: In your applications needs to load a web browser we use
intent to invoke a built-in web page instead of building our
own page.
43
46. Intent Objects
• An Intent object can contain the following components based
on what it is going to perform −
• Action
• Data
46
47. Action & data
• This is mandatory part of the Intent object and is a string
naming the action to be performed .
• Adds a data specification to an intent filter. The specification
can be just a data type just a URI, or both a data type and a
URI.
47