You are on page 1of 16

Day 2: Components,

User Interface, Events


August 30 – September 1, 2012, St. Vincent College, Dipolog City
Exploring more about Activities and
Intents
Exploring more about Activities and
Intents
Exploring more about Activities and
Intents
– Activity # 3: Creating Application with Activities
– Activity # 4: Adding Intents
Activity # 3 & 4: Creating Application
with Activities with Intents
• Please refer to example presented
• Time: 45-60 mins.
Android User Interface
• Ways to Create Interface: Declarative vs.
Programmatic
– Declarative: involves using XML to declare what
the UI will look like
– Programmatic: involves writing Java code to
develop UI ( Java AWT or Java Swing)
Android User Interface
• Views and Layouts
• Widgets (TextView, Button, etc..)
• Adding Colors and Images
• Menus
• Dialogs
View Hierarchy
View Hierarchy
Layouts
• LinearLayout
• RelativeLayout
• TableLayout
• AbsoluteLayout
LinearLayout
• LinearLayout is a box model — widgets or
child containers are lined up in a column or
row, oneafter the next.
• To configure a LinearLayout, you have five
main areas of control besides the container’s
contents:
– the orientation, fill model, weight, gravity, and the
padding.
RelativeLayout
• RelativeLayout, lays out widgets based upon
their relationship to other widgets in the
container and in the parent container.
• You can place Widget X below and to the left
of Widget Y, or have Widget Z’s bottom edge
align with the bottom of the container, and so
on.
TableLayout
• TableLayout works in conjunction with
TableRow.
• TableLayout controls the overall behavior of
the container, with the widgets themselves
poured into one or more TableRow
containers, one per row in the grid.
More hands-on activities….
• Widgets (TextView, Button, etc..)
• Adding Colors and Images
• Menus
• Dialogs
Activity # 5: Creating Form with
Widgets and Intents
• Please refer to example presented
• Time: 60 mins.
Events & Gestures
• Handling Events
– Event Listeners
– Event Handlers
– Touch Mode
– Focus
– Activity # 6: Utilizing Events
• Gestures

You might also like