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.
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 :)