SlideShare uma empresa Scribd logo
1 de 52
Baixar para ler offline
UI controls in
Android
Divya K.S
1
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
3
4
5
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
7
8
9
10
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
12
13
14
15
16
17
18
19
• v
20
Toggle button attributes
21
button
22
23
24
Image button
25
26
Check box
27
28
Radio button
29
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
31
32
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
• In order to use TimePicker class, you have to first define the
TimePicker component in your activity.xml. It is define as below −
34
35
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
• 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
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
39
40
41
INTENT
• An intent is an abstract description of an operation to be
performed.
• It can be used with startActivity to launch an Activity.
42
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
44
45
Intent Objects
• An Intent object can contain the following components based
on what it is going to perform −
• Action
• Data
46
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
48
49
50
51
THANK YOU
52

Mais conteúdo relacionado

Mais procurados

android activity
android activityandroid activity
android activity
Deepa Rani
 

Mais procurados (20)

AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development ppt
 
Android Location and Maps
Android Location and MapsAndroid Location and Maps
Android Location and Maps
 
Android Basic Components
Android Basic ComponentsAndroid Basic Components
Android Basic Components
 
Android share preferences
Android share preferencesAndroid share preferences
Android share preferences
 
android activity
android activityandroid activity
android activity
 
Android Services
Android ServicesAndroid Services
Android Services
 
Fragment
Fragment Fragment
Fragment
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 
Android styles and themes
Android styles and themesAndroid styles and themes
Android styles and themes
 
Android intents
Android intentsAndroid intents
Android intents
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
 
Introduction to Android development - Presentation
Introduction to Android development - PresentationIntroduction to Android development - Presentation
Introduction to Android development - Presentation
 
Android Architecture.pptx
Android Architecture.pptxAndroid Architecture.pptx
Android Architecture.pptx
 
Google Maps in Android
Google Maps in AndroidGoogle Maps in Android
Google Maps in Android
 
Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in android
 
Data Storage In Android
Data Storage In Android Data Storage In Android
Data Storage In Android
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming Basics
 
Graphical User Interface (Gui)
Graphical User Interface (Gui)Graphical User Interface (Gui)
Graphical User Interface (Gui)
 
Windows form application_in_vb(vb.net --3 year)
Windows form application_in_vb(vb.net --3 year)Windows form application_in_vb(vb.net --3 year)
Windows form application_in_vb(vb.net --3 year)
 

Semelhante a UI controls in Android

Android App Development 03 : Widget & UI
Android App Development 03 : Widget & UIAndroid App Development 03 : Widget & UI
Android App Development 03 : Widget & UI
Anuchit Chalothorn
 

Semelhante a UI controls in Android (20)

Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Android App Development 03 : Widget & UI
Android App Development 03 : Widget & UIAndroid App Development 03 : Widget & UI
Android App Development 03 : Widget & UI
 
Android Development Tutorial
Android Development TutorialAndroid Development Tutorial
Android Development Tutorial
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
 
Advanced Coded UI Testing
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI Testing
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.doc
 
Unit 2
Unit 2Unit 2
Unit 2
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
 
Android training day 2
Android training day 2Android training day 2
Android training day 2
 
Android app development
Android app developmentAndroid app development
Android app development
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
 
01 09 - graphical user interface - basic widgets
01  09 - graphical user interface - basic widgets01  09 - graphical user interface - basic widgets
01 09 - graphical user interface - basic widgets
 
Android App development III
Android App development IIIAndroid App development III
Android App development III
 
Android Made Simple
Android Made SimpleAndroid Made Simple
Android Made Simple
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
 
Android class provider in mumbai
Android class provider in mumbaiAndroid class provider in mumbai
Android class provider in mumbai
 
Android development first steps
Android development   first stepsAndroid development   first steps
Android development first steps
 
Notes Unit3.pptx
Notes Unit3.pptxNotes Unit3.pptx
Notes Unit3.pptx
 
Android best training-in-mumbai
Android best training-in-mumbaiAndroid best training-in-mumbai
Android best training-in-mumbai
 

Mais de DivyaKS12

Mais de DivyaKS12 (13)

NUMBER SYSTEM.pptx
NUMBER SYSTEM.pptxNUMBER SYSTEM.pptx
NUMBER SYSTEM.pptx
 
unit 3.pptx
unit 3.pptxunit 3.pptx
unit 3.pptx
 
PCCF UNIT 2.pptx
PCCF UNIT 2.pptxPCCF UNIT 2.pptx
PCCF UNIT 2.pptx
 
PCCF UNIT 1.pptx
PCCF UNIT 1.pptxPCCF UNIT 1.pptx
PCCF UNIT 1.pptx
 
DBMS-INTRODUCTION.pptx
DBMS-INTRODUCTION.pptxDBMS-INTRODUCTION.pptx
DBMS-INTRODUCTION.pptx
 
Database models and DBMS languages
Database models and DBMS languagesDatabase models and DBMS languages
Database models and DBMS languages
 
Operation research (definition, phases)
Operation research (definition, phases)Operation research (definition, phases)
Operation research (definition, phases)
 
Types of Computer Modem
Types of Computer ModemTypes of Computer Modem
Types of Computer Modem
 
Fragments In Android
Fragments In AndroidFragments In Android
Fragments In Android
 
Android os(comparison all other mobile os)
Android os(comparison all other mobile os)Android os(comparison all other mobile os)
Android os(comparison all other mobile os)
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
 
CSS
CSSCSS
CSS
 
Internet technology
Internet technologyInternet technology
Internet technology
 

Último

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Último (20)

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 

UI controls in Android

  • 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
  • 3. 3
  • 4. 4
  • 5. 5
  • 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
  • 7. 7
  • 8. 8
  • 9. 9
  • 10. 10
  • 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
  • 12. 12
  • 13. 13
  • 14. 14
  • 15. 15
  • 16. 16
  • 17. 17
  • 18. 18
  • 19. 19
  • 23. 23
  • 24. 24
  • 26. 26
  • 28. 28
  • 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
  • 31. 31
  • 32. 32
  • 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
  • 35. 35
  • 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
  • 39. 39
  • 40. 40
  • 41. 41
  • 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
  • 44. 44
  • 45. 45
  • 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
  • 48. 48
  • 49. 49
  • 50. 50
  • 51. 51