SlideShare a Scribd company logo
1 of 28
Android Application Development User Interface Ahsanul Karim [email_address] Sentinel Solutions Ltd. http://www.sentinelbd.com
User Interface Today ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],We have already used  TextView ,  EditText  and  Button
User Interface Android Widget Toolbox Form Elements Tutorial ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.) ,[object Object],[object Object],3. onCreate()  
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Custom Button Normal Focused Pressed We’ll create an image button with 3 states Using the  Button  widget and an XML file that defines  three different images  to use for the  different button states. When the button is pressed, a short message will be displayed. ,[object Object],[object Object],[object Object],[object Object],This defines a single drawable resource, which will change its image based on the current state  of the button.
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Custom Button 3. Open the  res/layout/main.xml  file and add the  Button  element: The   android:background  attribute specifies the drawable  resource to use for the button background (which, when saved at res/drawable/android.xml,  is referenced as @drawable/android). This replaces the normal background image used for  buttons throughout the system. In order for the drawable to change its image based on the  button state, the image must be applied to the background
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Custom Button 4. o make the button do something when pressed, add the following code at the end of the  onCreate()  method: Normal Pressed After Pressed
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Edit Text In this section, you will create a text field for user input, using the  EditText  widget. Once text  has been entered into the field, the "Enter" key will display the text in a toast message. 1. Open the  res/layout/main.xml  file and add the  EditText  element (inside the  LinearLayout ): 2.
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Edit Text 2. To do something with the text that the user types, add the following code to the end of the  onCreate()  method:
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Edit Text
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Check Box In this section, you will create a checkbox for selecting items, using the  CheckBox  widget.  When the checkbox is pressed, a toast message will indicate the current state of the checkbox. 1. Open the  res/layout/main.xml  file and add the  CheckBox  element (inside the  LinearLayout ):
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Check Box 2. To do something when the state is changed, add the following code to the end of the  onCreate()  method:
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Check Box
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Radio Button In this section, you will create two mutually-exclusive radio buttons (enabling one disables the  other), using the  RadioGroup  and  RadioButton  widgets.  When either radio button is pressed, a toast message will be displayed. ,[object Object],[object Object],It's important that the  RadioButton s are grouped together by the  RadioGroup  element so that  no more than one can be selected at a time. This logic is automatically handled by the Android  system. When one  RadioButton  within a group is selected, all others are automatically deselected
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Radio Button 2. To do something when each  RadioButton  is selected, you need an  View.OnClickListener . In this case, you want the listener to be re-usable, so add the following code to create a new  member in the  HelloFormStuff  Activity 3. Now, at the bottom of the  onCreate()  method, add the following:
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Radio Button
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Toggle Button In this section, you'll create a button used specifically for toggling between two states, using  the  ToggleButton  widget. This widget is an excellent alternative to radio buttons if you have two simple states that are mutually exclusive ("on" and "off", for example). ,[object Object],[object Object]
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Toggle Button 2. To do something when the state is changed, add the following code to the end of the  onCreate()  method: This captures the  ToggleButton  element from the layout, then adds an  View.OnClickListener .  The  View.OnClickListener  must implement the  onClick(View)  callback method, which defines the action to perform when the button is clicked. In this example, the callback method checks  the new state of the button, then shows a  Toast  message that indicates the current state.
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Toggle Button
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Rating Bar In this section, you'll create a widget that allows the user to provide a rating, with the  RatingBar  widget. ,[object Object],[object Object],2. To do something when a new rating has been set, add the following code to the end of  the  onCreate()  method:
User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Rating Bar
User Interface Android Widget Toolbox Auto Complete Tutorial To create a text entry widget that provides auto-complete suggestions, use the  AutoCompleteTextView  widget. Suggestions are received from a collection of strings associated  with the widget through an  ArrayAdapter In this tutorial, you will create a  AutoCompleteTextView  widget that provides suggestions for  a country name.
User Interface Android Widget Toolbox Auto Complete Tutorial (Contd.) 1. Start a new project named  HelloAutoComplete . 2. Create an XML file named list_item.xml and save it inside the  res/layout/  folder.  Edit the file to look like this: This file defines a simple  TextView  that will be used for each item that appears in the list  of suggestions
User Interface Android Widget Toolbox Auto Complete Tutorial (Contd.) 3. Open the  res/layout/main.xml  file and insert the following: The  TextView  is a label that introduces the  AutoCompleteTextView  widget.
User Interface Android Widget Toolbox Auto Complete Tutorial (Contd.) 4. Open  HelloAutoComplete.java  and insert the following code for the  onCreate()  method: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
User Interface Android Widget Toolbox Auto Complete Tutorial (Contd.) 5. Inside the  HelloAutoComplete  class, add the string array:
User Interface Android Widget Toolbox Auto Complete Tutorial (Contd.) 6. Run the application
User Interface Android Widget Toolbox Auto Complete Tutorial (Contd.) 7. Recommended: This can be done with a <string-array< resource in your project  res/values/strings.xml  file. For example: 8. From source code:

More Related Content

What's hot

Android app development with kotlin heralding the future
Android app development with kotlin heralding the futureAndroid app development with kotlin heralding the future
Android app development with kotlin heralding the futureSPEC INDIA
 
Data Persistence in Android with Room Library
Data Persistence in Android with Room LibraryData Persistence in Android with Room Library
Data Persistence in Android with Room LibraryReinvently
 
Android studio 2.0: default project structure
Android studio 2.0: default project structureAndroid studio 2.0: default project structure
Android studio 2.0: default project structureVyara Georgieva
 
Mobile application development ppt
Mobile application development pptMobile application development ppt
Mobile application development ppttirupathinews
 
Fitness management application
Fitness management applicationFitness management application
Fitness management applicationRishabh Shukla
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp PresentationVishwa Mohan
 
A quick and fast intro to Kotlin
A quick and fast intro to Kotlin A quick and fast intro to Kotlin
A quick and fast intro to Kotlin XPeppers
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentAly Abdelkareem
 
What is flutter and why should i care?
What is flutter and why should i care?What is flutter and why should i care?
What is flutter and why should i care?Sergi Martínez
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Javaamaankhan
 
Android studio installation
Android studio installationAndroid studio installation
Android studio installationPoojaBele1
 
Getting started with flutter
Getting started with flutterGetting started with flutter
Getting started with flutterrihannakedy
 
Basic android-ppt
Basic android-pptBasic android-ppt
Basic android-pptSrijib Roy
 
Jetpack Compose.pptx
Jetpack Compose.pptxJetpack Compose.pptx
Jetpack Compose.pptxGDSCVJTI
 
android activity
android activityandroid activity
android activityDeepa Rani
 

What's hot (20)

C# basics
 C# basics C# basics
C# basics
 
Android app development with kotlin heralding the future
Android app development with kotlin heralding the futureAndroid app development with kotlin heralding the future
Android app development with kotlin heralding the future
 
Data Persistence in Android with Room Library
Data Persistence in Android with Room LibraryData Persistence in Android with Room Library
Data Persistence in Android with Room Library
 
Flutter
FlutterFlutter
Flutter
 
Android studio 2.0: default project structure
Android studio 2.0: default project structureAndroid studio 2.0: default project structure
Android studio 2.0: default project structure
 
Mobile application development ppt
Mobile application development pptMobile application development ppt
Mobile application development ppt
 
Fitness management application
Fitness management applicationFitness management application
Fitness management application
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
 
SQLite database in android
SQLite database in androidSQLite database in android
SQLite database in android
 
A quick and fast intro to Kotlin
A quick and fast intro to Kotlin A quick and fast intro to Kotlin
A quick and fast intro to Kotlin
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
What is flutter and why should i care?
What is flutter and why should i care?What is flutter and why should i care?
What is flutter and why should i care?
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 
Android studio installation
Android studio installationAndroid studio installation
Android studio installation
 
Getting started with flutter
Getting started with flutterGetting started with flutter
Getting started with flutter
 
Basic android-ppt
Basic android-pptBasic android-ppt
Basic android-ppt
 
Jetpack Compose.pptx
Jetpack Compose.pptxJetpack Compose.pptx
Jetpack Compose.pptx
 
android activity
android activityandroid activity
android activity
 
Android intents
Android intentsAndroid intents
Android intents
 
Android Widget
Android WidgetAndroid Widget
Android Widget
 

Viewers also liked

Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewAhsanul Karim
 
Lecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & PreferencesLecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & PreferencesAhsanul Karim
 
Day 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIDay 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIAhsanul Karim
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentAhsanul Karim
 
Multiple Activity and Navigation Primer
Multiple Activity and Navigation PrimerMultiple Activity and Navigation Primer
Multiple Activity and Navigation PrimerAhsanul Karim
 
Introduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting StartedIntroduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting StartedAhsanul Karim
 
Day 1 Android: Before Getting Started
Day 1 Android: Before Getting StartedDay 1 Android: Before Getting Started
Day 1 Android: Before Getting StartedAhsanul Karim
 
Day 15: Working in Background
Day 15: Working in BackgroundDay 15: Working in Background
Day 15: Working in BackgroundAhsanul Karim
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentAhsanul Karim
 
Day 9: Make Your App Location Aware using Location API
Day 9: Make Your App Location Aware using Location APIDay 9: Make Your App Location Aware using Location API
Day 9: Make Your App Location Aware using Location APIAhsanul Karim
 
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAndroid User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAhsanul Karim
 
Day 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesDay 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesAhsanul Karim
 
Day 2 android internals a quick overview
Day 2 android internals a quick overviewDay 2 android internals a quick overview
Day 2 android internals a quick overviewAhsanul Karim
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI WidgetsAhsanul Karim
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivityAhsanul Karim
 
Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Ahsanul Karim
 
Sensors in Android (old)
Sensors in Android (old)Sensors in Android (old)
Sensors in Android (old)Ahsanul Karim
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studioParinita03
 

Viewers also liked (20)

Android Services
Android ServicesAndroid Services
Android Services
 
Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick Overview
 
Lecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & PreferencesLecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & Preferences
 
Day 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIDay 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts API
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application Development
 
Multiple Activity and Navigation Primer
Multiple Activity and Navigation PrimerMultiple Activity and Navigation Primer
Multiple Activity and Navigation Primer
 
Introduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting StartedIntroduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting Started
 
Day 1 Android: Before Getting Started
Day 1 Android: Before Getting StartedDay 1 Android: Before Getting Started
Day 1 Android: Before Getting Started
 
Day 15: Working in Background
Day 15: Working in BackgroundDay 15: Working in Background
Day 15: Working in Background
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver Component
 
Day 9: Make Your App Location Aware using Location API
Day 9: Make Your App Location Aware using Location APIDay 9: Make Your App Location Aware using Location API
Day 9: Make Your App Location Aware using Location API
 
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAndroid User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
 
Day 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesDay 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through Activities
 
Day 2 android internals a quick overview
Day 2 android internals a quick overviewDay 2 android internals a quick overview
Day 2 android internals a quick overview
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivity
 
Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3
 
Sensors in Android (old)
Sensors in Android (old)Sensors in Android (old)
Sensors in Android (old)
 
Training android
Training androidTraining android
Training android
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studio
 

Similar to Android User Interface: Basic Form Widgets

Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Ahsanul Karim
 
Android Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidDenis Minja
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lecturesmarwaeng
 
intro_gui
intro_guiintro_gui
intro_guifilipb2
 
Programming Without Coding Technology (PWCT) - Functions and Procedures
Programming Without Coding Technology (PWCT) - Functions and ProceduresProgramming Without Coding Technology (PWCT) - Functions and Procedures
Programming Without Coding Technology (PWCT) - Functions and ProceduresMahmoud Samir Fayed
 
Programming Without Coding Technology (PWCT) - Crystal Reports 10
Programming Without Coding Technology (PWCT) - Crystal Reports 10Programming Without Coding Technology (PWCT) - Crystal Reports 10
Programming Without Coding Technology (PWCT) - Crystal Reports 10Mahmoud Samir Fayed
 
Programming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Simple GUI ApplicationProgramming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Simple GUI ApplicationMahmoud Samir Fayed
 
Gui builder
Gui builderGui builder
Gui builderlearnt
 
Programming Without Coding Technology (PWCT) - Variables
Programming Without Coding Technology (PWCT) - VariablesProgramming Without Coding Technology (PWCT) - Variables
Programming Without Coding Technology (PWCT) - VariablesMahmoud Samir Fayed
 
Programming Without Coding Technology (PWCT) - Tab control
Programming Without Coding Technology (PWCT) - Tab controlProgramming Without Coding Technology (PWCT) - Tab control
Programming Without Coding Technology (PWCT) - Tab controlMahmoud Samir Fayed
 
Keynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptxKeynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptxEqraKhattak
 
Programming Without Coding Technology (PWCT) - Create Database Files (*.DBF)
Programming Without Coding Technology (PWCT) - Create Database Files (*.DBF)Programming Without Coding Technology (PWCT) - Create Database Files (*.DBF)
Programming Without Coding Technology (PWCT) - Create Database Files (*.DBF)Mahmoud Samir Fayed
 
Programming Without Coding Technology (PWCT) - Convert the data type of varai...
Programming Without Coding Technology (PWCT) - Convert the data type of varai...Programming Without Coding Technology (PWCT) - Convert the data type of varai...
Programming Without Coding Technology (PWCT) - Convert the data type of varai...Mahmoud Samir Fayed
 
Chapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface DesignChapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface Designfrancopw
 
Programming Without Coding Technology (PWCT) - Get Input From User
Programming Without Coding Technology (PWCT) - Get Input From UserProgramming Without Coding Technology (PWCT) - Get Input From User
Programming Without Coding Technology (PWCT) - Get Input From UserMahmoud Samir Fayed
 
Programming Without Coding Technology (PWCT) - How to deal with Memo Variables.
Programming Without Coding Technology (PWCT) - How to deal with Memo Variables.Programming Without Coding Technology (PWCT) - How to deal with Memo Variables.
Programming Without Coding Technology (PWCT) - How to deal with Memo Variables.Mahmoud Samir Fayed
 

Similar to Android User Interface: Basic Form Widgets (20)

Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]
 
Android UI
Android UIAndroid UI
Android UI
 
Android Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_android
 
4.C#
4.C#4.C#
4.C#
 
Create New Android Layout
Create New Android LayoutCreate New Android Layout
Create New Android Layout
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
 
intro_gui
intro_guiintro_gui
intro_gui
 
GUI components in Java
GUI components in JavaGUI components in Java
GUI components in Java
 
Programming Without Coding Technology (PWCT) - Functions and Procedures
Programming Without Coding Technology (PWCT) - Functions and ProceduresProgramming Without Coding Technology (PWCT) - Functions and Procedures
Programming Without Coding Technology (PWCT) - Functions and Procedures
 
Programming Without Coding Technology (PWCT) - Crystal Reports 10
Programming Without Coding Technology (PWCT) - Crystal Reports 10Programming Without Coding Technology (PWCT) - Crystal Reports 10
Programming Without Coding Technology (PWCT) - Crystal Reports 10
 
Programming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Simple GUI ApplicationProgramming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Simple GUI Application
 
Gui builder
Gui builderGui builder
Gui builder
 
Programming Without Coding Technology (PWCT) - Variables
Programming Without Coding Technology (PWCT) - VariablesProgramming Without Coding Technology (PWCT) - Variables
Programming Without Coding Technology (PWCT) - Variables
 
Programming Without Coding Technology (PWCT) - Tab control
Programming Without Coding Technology (PWCT) - Tab controlProgramming Without Coding Technology (PWCT) - Tab control
Programming Without Coding Technology (PWCT) - Tab control
 
Keynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptxKeynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptx
 
Programming Without Coding Technology (PWCT) - Create Database Files (*.DBF)
Programming Without Coding Technology (PWCT) - Create Database Files (*.DBF)Programming Without Coding Technology (PWCT) - Create Database Files (*.DBF)
Programming Without Coding Technology (PWCT) - Create Database Files (*.DBF)
 
Programming Without Coding Technology (PWCT) - Convert the data type of varai...
Programming Without Coding Technology (PWCT) - Convert the data type of varai...Programming Without Coding Technology (PWCT) - Convert the data type of varai...
Programming Without Coding Technology (PWCT) - Convert the data type of varai...
 
Chapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface DesignChapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface Design
 
Programming Without Coding Technology (PWCT) - Get Input From User
Programming Without Coding Technology (PWCT) - Get Input From UserProgramming Without Coding Technology (PWCT) - Get Input From User
Programming Without Coding Technology (PWCT) - Get Input From User
 
Programming Without Coding Technology (PWCT) - How to deal with Memo Variables.
Programming Without Coding Technology (PWCT) - How to deal with Memo Variables.Programming Without Coding Technology (PWCT) - How to deal with Memo Variables.
Programming Without Coding Technology (PWCT) - How to deal with Memo Variables.
 

More from Ahsanul Karim

Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities Ahsanul Karim
 
Lecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting StartedLecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting StartedAhsanul Karim
 
লেকচার ১ (ক)- শুরুর আগে:
লেকচার ১ (ক)- শুরুর আগে:লেকচার ১ (ক)- শুরুর আগে:
লেকচার ১ (ক)- শুরুর আগে:Ahsanul Karim
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsAhsanul Karim
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsAhsanul Karim
 
Day 4: Activity lifecycle
Day 4: Activity lifecycleDay 4: Activity lifecycle
Day 4: Activity lifecycleAhsanul Karim
 
Mobile Banking in Bangladesh: An Incomplete Study
Mobile Banking in Bangladesh: An Incomplete StudyMobile Banking in Bangladesh: An Incomplete Study
Mobile Banking in Bangladesh: An Incomplete StudyAhsanul Karim
 
Ui layout (incomplete)
Ui layout (incomplete)Ui layout (incomplete)
Ui layout (incomplete)Ahsanul Karim
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_startedAhsanul Karim
 
Action Bar Sherlock tutorial
Action Bar Sherlock tutorialAction Bar Sherlock tutorial
Action Bar Sherlock tutorialAhsanul Karim
 
Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Ahsanul Karim
 
Android before getting started
Android before getting startedAndroid before getting started
Android before getting startedAhsanul Karim
 

More from Ahsanul Karim (16)

Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities
 
Lecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting StartedLecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting Started
 
লেকচার ১ (ক)- শুরুর আগে:
লেকচার ১ (ক)- শুরুর আগে:লেকচার ১ (ক)- শুরুর আগে:
লেকচার ১ (ক)- শুরুর আগে:
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
 
Day 4: Activity lifecycle
Day 4: Activity lifecycleDay 4: Activity lifecycle
Day 4: Activity lifecycle
 
Mobile Banking in Bangladesh: An Incomplete Study
Mobile Banking in Bangladesh: An Incomplete StudyMobile Banking in Bangladesh: An Incomplete Study
Mobile Banking in Bangladesh: An Incomplete Study
 
GCM for Android
GCM for AndroidGCM for Android
GCM for Android
 
List Views
List ViewsList Views
List Views
 
Ui layout (incomplete)
Ui layout (incomplete)Ui layout (incomplete)
Ui layout (incomplete)
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_started
 
Action Bar Sherlock tutorial
Action Bar Sherlock tutorialAction Bar Sherlock tutorial
Action Bar Sherlock tutorial
 
Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2
 
Android 1.8 sensor
Android 1.8 sensorAndroid 1.8 sensor
Android 1.8 sensor
 
Android before getting started
Android before getting startedAndroid before getting started
Android before getting started
 

Recently uploaded

Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 

Recently uploaded (20)

Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 

Android User Interface: Basic Form Widgets

  • 1. Android Application Development User Interface Ahsanul Karim [email_address] Sentinel Solutions Ltd. http://www.sentinelbd.com
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Custom Button 3. Open the  res/layout/main.xml  file and add the  Button  element: The   android:background  attribute specifies the drawable resource to use for the button background (which, when saved at res/drawable/android.xml, is referenced as @drawable/android). This replaces the normal background image used for buttons throughout the system. In order for the drawable to change its image based on the button state, the image must be applied to the background
  • 7. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Custom Button 4. o make the button do something when pressed, add the following code at the end of the  onCreate()  method: Normal Pressed After Pressed
  • 8. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Edit Text In this section, you will create a text field for user input, using the  EditText  widget. Once text has been entered into the field, the &quot;Enter&quot; key will display the text in a toast message. 1. Open the  res/layout/main.xml  file and add the  EditText  element (inside the  LinearLayout ): 2.
  • 9. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Edit Text 2. To do something with the text that the user types, add the following code to the end of the  onCreate()  method:
  • 10. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Edit Text
  • 11. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Check Box In this section, you will create a checkbox for selecting items, using the  CheckBox  widget. When the checkbox is pressed, a toast message will indicate the current state of the checkbox. 1. Open the  res/layout/main.xml  file and add the  CheckBox  element (inside the  LinearLayout ):
  • 12. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Check Box 2. To do something when the state is changed, add the following code to the end of the  onCreate()  method:
  • 13. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Check Box
  • 14.
  • 15. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Radio Button 2. To do something when each  RadioButton  is selected, you need an  View.OnClickListener . In this case, you want the listener to be re-usable, so add the following code to create a new member in the  HelloFormStuff  Activity 3. Now, at the bottom of the  onCreate()  method, add the following:
  • 16. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Radio Button
  • 17.
  • 18. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Toggle Button 2. To do something when the state is changed, add the following code to the end of the  onCreate()  method: This captures the  ToggleButton  element from the layout, then adds an  View.OnClickListener . The  View.OnClickListener  must implement the  onClick(View)  callback method, which defines the action to perform when the button is clicked. In this example, the callback method checks the new state of the button, then shows a  Toast  message that indicates the current state.
  • 19. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Toggle Button
  • 20.
  • 21. User Interface Android Widget Toolbox Form Elements Tutorial (Contd.)- Rating Bar
  • 22. User Interface Android Widget Toolbox Auto Complete Tutorial To create a text entry widget that provides auto-complete suggestions, use the  AutoCompleteTextView  widget. Suggestions are received from a collection of strings associated with the widget through an  ArrayAdapter In this tutorial, you will create a  AutoCompleteTextView  widget that provides suggestions for a country name.
  • 23. User Interface Android Widget Toolbox Auto Complete Tutorial (Contd.) 1. Start a new project named  HelloAutoComplete . 2. Create an XML file named list_item.xml and save it inside the  res/layout/  folder. Edit the file to look like this: This file defines a simple  TextView  that will be used for each item that appears in the list of suggestions
  • 24. User Interface Android Widget Toolbox Auto Complete Tutorial (Contd.) 3. Open the  res/layout/main.xml  file and insert the following: The  TextView  is a label that introduces the  AutoCompleteTextView  widget.
  • 25.
  • 26. User Interface Android Widget Toolbox Auto Complete Tutorial (Contd.) 5. Inside the  HelloAutoComplete  class, add the string array:
  • 27. User Interface Android Widget Toolbox Auto Complete Tutorial (Contd.) 6. Run the application
  • 28. User Interface Android Widget Toolbox Auto Complete Tutorial (Contd.) 7. Recommended: This can be done with a <string-array< resource in your project  res/values/strings.xml  file. For example: 8. From source code: