SlideShare a Scribd company logo
1 of 18
Android Development
BootCamp
Day 04
Getting Familiar with Event Handling and Layouts
in Android
A Little Introduction to Myself...
Zainab Khan
Final Year Student of B.E Software from MUET.
Former DSC Expert Team Member.
Interested in Android Development and likes to work on it.
Would love to help you guys out with whatever I know.
You can connect with me on my:
zainabyounus63@gmail.com
https://www.facebook.com/zainab.younus.18/
www.linkedin.com/in/zainab-younus-khan
What we will be doing
today?
Look into three layouts of Android UI Development.
Which ones?
● Table Layout.
● Grid Layout.
● Frame Layout.
While exploring them, you’ll be learning ‘click/event handling’ in Android.
Last but no the least, we will try to cooperate with each other with the best
of our behaviours yeah? Don’t hesitate to ask a question in chatbox for
now, but remember we are going to learn together so I may not be the
perfect guru. LET’S LEARN TOGETHER :)
Let’s Start!
Event Handling
Handling Click Events
When you press a view (usually button) on your app’s UI, an event gets triggered resulting into
some action (preferably the desired one).
But how to handle those clicks to get that desired action performed?
Well, in Android there are two ways to handle button clicks. Let’s check them out!
1. Using onClick() method.
2. Using onClickListener().
1) Using onClick() method
Two steps:
1. Define onClick property of button in XML.
2. Now, handle the view in your Java file.
2) Using onClickListener()
As the name suggests, click listeners automatically listens for click events, so you don’t need to
explicitly mention an attribute for them in XML.
In Java file, Initialize the view (button in this case) and define a click listener for it.
Layouts
What is a Layout?
➔ A layout is something that defines the structure of a user interface in your app, using
hierarchies of views and view groups.
➔ It tells how the UI components will be rendered on the screen for the user.
Why are Layouts Important?
➔ If you are not putting your views into a particular structure or hierarchy, they will be
floating on the screen as they want, which is obviously not required.
➔ Structuring is important prior to designing.
➔ Inefficient use of layouts can frustrate your users, increase confusions, and lead to high
performance costs with inefficient use of resources and components.
Some Important Layouts
Linear Layout.
Relative Layout.
Table Layout.
Absolute Layout.
Frame Layout.
ListView.
Grid Layout.
Linear Layout is a view group that aligns all children in a single direction, vertically or
horizontally.
Relative Layout is a view group that displays child views in relative positions.
Table Layout is a view that groups views into rows and columns.
Absolute Layout enables you to specify the exact location of its children.
The Frame Layout is a placeholder on screen that you can use to display a single view.
ListView is a view group that displays a list of scrollable items.
Grid Layout is a layout manager that arranges the views in a grid..
TABLE LAYOUT
➔ Android TableLayout is going to be arrange groups of
views into rows and columns.
➔ You will use the <TableRow> element to build a row
in the table.
➔ Each row has zero or more cells; each cell can hold
one View object.
Grid Layout
➔ In Android GridLayout, we can specify the number of columns
and rows that the grid will have.
➔ We can customize the GridLayout according to our
requirements, like setting the size, color or the margin for the
Layout.
➔ So, a GridLayout basically places its children in a rectangular
grid. This grid has a set of a number of thin lines that separate
the view area into cells.
➔ Each item in a grid cell can be pointed using its index number.
Frame Layout
➔ Frame Layout is designed to block out an area on the screen to
display a single item.
➔ Generally, FrameLayout should be used to hold a single child
view, because it can be difficult to organize child views in a
way that's scalable to different screen sizes without the
children overlapping each other.
➔ You can, however, add multiple children to a FrameLayout and
control their position within the FrameLayout by assigning
gravity to each child, using the android:layout_gravity
attribute.
Are We DONE?
YES?
High Five!
Ask Away Questions!
Some Tips!
★ Try different things if you haven’t. Explore maps, databases, services, broadcasts, AI in android, different layouts, etc.
★ Try to implement SDLC phases.
★ Test your app. You can use automated tools or do it manually (Assure SW Quality)
★ Document even your simplest apps at least with a paragraph long description, along with some screenshots or short screen
recordings.
★ Upload them on Github PLEASE!
★ Make your LinkedIn profile and try to do things that can be fitted into it.
★ Make your Resume.
★ Make connections.
★ Participate in Coding Expos and Project Exhibitions.
★ MUST do internships of at least 3-4 weeks, in interested areas.
★ Go Native!
★ DON’T WASTE YOUR MONEY ON USELESS EVENTS. Other than the ones which teach you something you don’t know, and can
have a place in your experience count.
★ Join Communities and related groups.
★ Stay Connected and HELP each other :)
References
https://developer.android.com/guide/topics/ui/controls/button#java
https://developer.android.com/guide/topics/ui/declaring-layout
https://www.tutorialspoint.com/android/android_user_interface_layouts.htm
https://www.tutorialspoint.com/android/android_table_layout.htm
https://data-flair.training/blogs/android-gridlayout/
https://www.tutorialspoint.com/android/android_frame_layout.htm

More Related Content

Similar to Day 4 android bootcamp

"Smarter Responsive Design" by Sam Otis
"Smarter Responsive Design" by Sam Otis"Smarter Responsive Design" by Sam Otis
"Smarter Responsive Design" by Sam OtisBlend Interactive
 
Life is not static - your designs shouldn't be either - No Code Conf 2019 Wor...
Life is not static - your designs shouldn't be either - No Code Conf 2019 Wor...Life is not static - your designs shouldn't be either - No Code Conf 2019 Wor...
Life is not static - your designs shouldn't be either - No Code Conf 2019 Wor...Webflow
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfacesC.o. Nieto
 
12 Phases of Web Development Life Cycle
12 Phases of Web Development Life Cycle12 Phases of Web Development Life Cycle
12 Phases of Web Development Life CycleNCode Technologies Inc.
 
Lavacon 2014 responsive design in your hat
Lavacon 2014   responsive design in your hatLavacon 2014   responsive design in your hat
Lavacon 2014 responsive design in your hatNeil Perlin
 
Mobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdfMobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdfAbdullahMunir32
 
Uxpin web ui design patterns 2014
Uxpin web ui design patterns 2014Uxpin web ui design patterns 2014
Uxpin web ui design patterns 2014MoodLabs
 
Design & Usability Basics
Design & Usability BasicsDesign & Usability Basics
Design & Usability Basicselmorandall
 
User experience and interactions design
User experience and interactions design User experience and interactions design
User experience and interactions design Rakesh Jha
 
Android Training (Android UI)
Android Training (Android UI)Android Training (Android UI)
Android Training (Android UI)Khaled Anaqwa
 
hema ppt (2).pptx
hema ppt (2).pptxhema ppt (2).pptx
hema ppt (2).pptxbalasekaran5
 
Bank Chris - Web UI Design Patterns - 2014
Bank Chris - Web UI Design Patterns - 2014Bank Chris - Web UI Design Patterns - 2014
Bank Chris - Web UI Design Patterns - 2014Shah Muhammad Baig
 
Embracing Uncertainty: Learning to Think Responsively
Embracing Uncertainty: Learning to Think ResponsivelyEmbracing Uncertainty: Learning to Think Responsively
Embracing Uncertainty: Learning to Think ResponsivelyChad Currie
 
Startup Institute NYC: Styling
Startup Institute NYC: StylingStartup Institute NYC: Styling
Startup Institute NYC: StylingMatthew Gerrior
 
Web UI Design Patterns 2014
Web UI Design Patterns 2014Web UI Design Patterns 2014
Web UI Design Patterns 2014Lewis Lin 🦊
 
Everything you ever wanted to know about Webflow Interactions - No Code Conf ...
Everything you ever wanted to know about Webflow Interactions - No Code Conf ...Everything you ever wanted to know about Webflow Interactions - No Code Conf ...
Everything you ever wanted to know about Webflow Interactions - No Code Conf ...Webflow
 

Similar to Day 4 android bootcamp (20)

"Smarter Responsive Design" by Sam Otis
"Smarter Responsive Design" by Sam Otis"Smarter Responsive Design" by Sam Otis
"Smarter Responsive Design" by Sam Otis
 
Presentation Ux
Presentation UxPresentation Ux
Presentation Ux
 
Life is not static - your designs shouldn't be either - No Code Conf 2019 Wor...
Life is not static - your designs shouldn't be either - No Code Conf 2019 Wor...Life is not static - your designs shouldn't be either - No Code Conf 2019 Wor...
Life is not static - your designs shouldn't be either - No Code Conf 2019 Wor...
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfaces
 
12 Phases of Web Development Life Cycle
12 Phases of Web Development Life Cycle12 Phases of Web Development Life Cycle
12 Phases of Web Development Life Cycle
 
Lavacon 2014 responsive design in your hat
Lavacon 2014   responsive design in your hatLavacon 2014   responsive design in your hat
Lavacon 2014 responsive design in your hat
 
Mobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdfMobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdf
 
Ux Example
Ux ExampleUx Example
Ux Example
 
Uxpin web ui design patterns 2014
Uxpin web ui design patterns 2014Uxpin web ui design patterns 2014
Uxpin web ui design patterns 2014
 
Design & Usability Basics
Design & Usability BasicsDesign & Usability Basics
Design & Usability Basics
 
User experience and interactions design
User experience and interactions design User experience and interactions design
User experience and interactions design
 
Android Training (Android UI)
Android Training (Android UI)Android Training (Android UI)
Android Training (Android UI)
 
hema ppt (2).pptx
hema ppt (2).pptxhema ppt (2).pptx
hema ppt (2).pptx
 
Bank Chris - Web UI Design Patterns - 2014
Bank Chris - Web UI Design Patterns - 2014Bank Chris - Web UI Design Patterns - 2014
Bank Chris - Web UI Design Patterns - 2014
 
Ui 5
Ui   5Ui   5
Ui 5
 
Embracing Uncertainty: Learning to Think Responsively
Embracing Uncertainty: Learning to Think ResponsivelyEmbracing Uncertainty: Learning to Think Responsively
Embracing Uncertainty: Learning to Think Responsively
 
Startup Institute NYC: Styling
Startup Institute NYC: StylingStartup Institute NYC: Styling
Startup Institute NYC: Styling
 
Web UI Design Patterns 2014
Web UI Design Patterns 2014Web UI Design Patterns 2014
Web UI Design Patterns 2014
 
Visualiser
Visualiser Visualiser
Visualiser
 
Everything you ever wanted to know about Webflow Interactions - No Code Conf ...
Everything you ever wanted to know about Webflow Interactions - No Code Conf ...Everything you ever wanted to know about Webflow Interactions - No Code Conf ...
Everything you ever wanted to know about Webflow Interactions - No Code Conf ...
 

More from FatimaYousif11

Day 2 react bootcamp
Day 2 react bootcampDay 2 react bootcamp
Day 2 react bootcampFatimaYousif11
 
The concept of vector art
The concept of vector artThe concept of vector art
The concept of vector artFatimaYousif11
 
CV/resume writing
CV/resume writingCV/resume writing
CV/resume writingFatimaYousif11
 
Day 8 sketchware
Day 8  sketchwareDay 8  sketchware
Day 8 sketchwareFatimaYousif11
 
Android local databases
Android local databasesAndroid local databases
Android local databasesFatimaYousif11
 
Day 5 android app code advancement
Day 5  android app code advancementDay 5  android app code advancement
Day 5 android app code advancementFatimaYousif11
 
Android app code mediator
Android app code mediatorAndroid app code mediator
Android app code mediatorFatimaYousif11
 
Android App code starter
Android App code starterAndroid App code starter
Android App code starterFatimaYousif11
 
Android bootcamp-day1
Android bootcamp-day1Android bootcamp-day1
Android bootcamp-day1FatimaYousif11
 
Getting started with android development
Getting started with android developmentGetting started with android development
Getting started with android developmentFatimaYousif11
 
Hacktoberfest slides
Hacktoberfest slidesHacktoberfest slides
Hacktoberfest slidesFatimaYousif11
 
Info session about dsc
Info session  about dscInfo session  about dsc
Info session about dscFatimaYousif11
 

More from FatimaYousif11 (15)

Day 2 react bootcamp
Day 2 react bootcampDay 2 react bootcamp
Day 2 react bootcamp
 
The concept of vector art
The concept of vector artThe concept of vector art
The concept of vector art
 
CV/resume writing
CV/resume writingCV/resume writing
CV/resume writing
 
Day 8 sketchware
Day 8  sketchwareDay 8  sketchware
Day 8 sketchware
 
Firebase
Firebase Firebase
Firebase
 
Android local databases
Android local databasesAndroid local databases
Android local databases
 
Day 5 android app code advancement
Day 5  android app code advancementDay 5  android app code advancement
Day 5 android app code advancement
 
Android app code mediator
Android app code mediatorAndroid app code mediator
Android app code mediator
 
Android App code starter
Android App code starterAndroid App code starter
Android App code starter
 
Android bootcamp-day1
Android bootcamp-day1Android bootcamp-day1
Android bootcamp-day1
 
Getting started with android development
Getting started with android developmentGetting started with android development
Getting started with android development
 
Oop
OopOop
Oop
 
Hello to Kotlin
Hello to KotlinHello to Kotlin
Hello to Kotlin
 
Hacktoberfest slides
Hacktoberfest slidesHacktoberfest slides
Hacktoberfest slides
 
Info session about dsc
Info session  about dscInfo session  about dsc
Info session about dsc
 

Recently uploaded

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Day 4 android bootcamp

  • 1. Android Development BootCamp Day 04 Getting Familiar with Event Handling and Layouts in Android
  • 2. A Little Introduction to Myself... Zainab Khan Final Year Student of B.E Software from MUET. Former DSC Expert Team Member. Interested in Android Development and likes to work on it. Would love to help you guys out with whatever I know. You can connect with me on my: zainabyounus63@gmail.com https://www.facebook.com/zainab.younus.18/ www.linkedin.com/in/zainab-younus-khan
  • 3. What we will be doing today? Look into three layouts of Android UI Development. Which ones? ● Table Layout. ● Grid Layout. ● Frame Layout. While exploring them, you’ll be learning ‘click/event handling’ in Android. Last but no the least, we will try to cooperate with each other with the best of our behaviours yeah? Don’t hesitate to ask a question in chatbox for now, but remember we are going to learn together so I may not be the perfect guru. LET’S LEARN TOGETHER :)
  • 6. Handling Click Events When you press a view (usually button) on your app’s UI, an event gets triggered resulting into some action (preferably the desired one). But how to handle those clicks to get that desired action performed? Well, in Android there are two ways to handle button clicks. Let’s check them out! 1. Using onClick() method. 2. Using onClickListener().
  • 7. 1) Using onClick() method Two steps: 1. Define onClick property of button in XML. 2. Now, handle the view in your Java file.
  • 8.
  • 9. 2) Using onClickListener() As the name suggests, click listeners automatically listens for click events, so you don’t need to explicitly mention an attribute for them in XML. In Java file, Initialize the view (button in this case) and define a click listener for it.
  • 11. What is a Layout? ➔ A layout is something that defines the structure of a user interface in your app, using hierarchies of views and view groups. ➔ It tells how the UI components will be rendered on the screen for the user. Why are Layouts Important? ➔ If you are not putting your views into a particular structure or hierarchy, they will be floating on the screen as they want, which is obviously not required. ➔ Structuring is important prior to designing. ➔ Inefficient use of layouts can frustrate your users, increase confusions, and lead to high performance costs with inefficient use of resources and components.
  • 12. Some Important Layouts Linear Layout. Relative Layout. Table Layout. Absolute Layout. Frame Layout. ListView. Grid Layout. Linear Layout is a view group that aligns all children in a single direction, vertically or horizontally. Relative Layout is a view group that displays child views in relative positions. Table Layout is a view that groups views into rows and columns. Absolute Layout enables you to specify the exact location of its children. The Frame Layout is a placeholder on screen that you can use to display a single view. ListView is a view group that displays a list of scrollable items. Grid Layout is a layout manager that arranges the views in a grid..
  • 13. TABLE LAYOUT ➔ Android TableLayout is going to be arrange groups of views into rows and columns. ➔ You will use the <TableRow> element to build a row in the table. ➔ Each row has zero or more cells; each cell can hold one View object.
  • 14. Grid Layout ➔ In Android GridLayout, we can specify the number of columns and rows that the grid will have. ➔ We can customize the GridLayout according to our requirements, like setting the size, color or the margin for the Layout. ➔ So, a GridLayout basically places its children in a rectangular grid. This grid has a set of a number of thin lines that separate the view area into cells. ➔ Each item in a grid cell can be pointed using its index number.
  • 15. Frame Layout ➔ Frame Layout is designed to block out an area on the screen to display a single item. ➔ Generally, FrameLayout should be used to hold a single child view, because it can be difficult to organize child views in a way that's scalable to different screen sizes without the children overlapping each other. ➔ You can, however, add multiple children to a FrameLayout and control their position within the FrameLayout by assigning gravity to each child, using the android:layout_gravity attribute.
  • 16. Are We DONE? YES? High Five! Ask Away Questions!
  • 17. Some Tips! ★ Try different things if you haven’t. Explore maps, databases, services, broadcasts, AI in android, different layouts, etc. ★ Try to implement SDLC phases. ★ Test your app. You can use automated tools or do it manually (Assure SW Quality) ★ Document even your simplest apps at least with a paragraph long description, along with some screenshots or short screen recordings. ★ Upload them on Github PLEASE! ★ Make your LinkedIn profile and try to do things that can be fitted into it. ★ Make your Resume. ★ Make connections. ★ Participate in Coding Expos and Project Exhibitions. ★ MUST do internships of at least 3-4 weeks, in interested areas. ★ Go Native! ★ DON’T WASTE YOUR MONEY ON USELESS EVENTS. Other than the ones which teach you something you don’t know, and can have a place in your experience count. ★ Join Communities and related groups. ★ Stay Connected and HELP each other :)